fortnox-api 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a553a96a17c448e49472e1b41e703382defbda6a54427709145b8d60e02f34f
4
- data.tar.gz: d7b3e147ad14c689c1fd24c7cf3529d3f951281c16d22bcbbf3c641ef2191d6e
3
+ metadata.gz: 707b9b050edd8499029c1f2120d11edc923e868847657eb0c108789014a5e3c8
4
+ data.tar.gz: 7da764b991529e720f3afbbb01433da52ca4f34800951b05c4f0f1e11f646c6a
5
5
  SHA512:
6
- metadata.gz: cef6687c30dca772585b966158dd94b17983c6393ca7e96fe619c154c0c312d7b4982978310a70469f0a4ddda0db2306a2fc6e9fc62ac31f45c2eb85930eb12f
7
- data.tar.gz: 597a1bbf5704b5a020d6add724ac1a7e375ab610d19ab0c2ca342148a4727a1fe22ca75de82d69581366d5bc345259c211570f5a93b019ded657c11a73ba8ffc
6
+ metadata.gz: 075e852a210ad2313fcf1c4469cb54a857016d46963e353679f16ea9e5daf09b28857491d9ccdc9b20c2a6843d7bc79093122db5419cf4219f1d830665af27b4
7
+ data.tar.gz: 35f8989ec19be2bf69c4f703daf54feb8b7d09e4c6bec95455c3483b23e4f8aa74547f781f2874c39d8903761feb769474bba0795ac2b3a21142a27b4ca706dc
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.7.2]
8
+ ### Fixed
9
+ - Invalid validation for Customer's account number attribute
10
+
7
11
  ## [0.7.1]
8
12
  ### Fixed
9
13
  - Invalid validation for Customer's country attributes
@@ -28,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
28
32
  ### Fixed
29
33
  - Model attribute `url` is no longer null
30
34
 
35
+ [0.7.2]: https://github.com/accodeing/fortnox-api/compare/v0.7.1...v0.7.2
31
36
  [0.7.1]: https://github.com/accodeing/fortnox-api/compare/v0.7.0...v0.7.1
32
37
  [0.7.0]: https://github.com/accodeing/fortnox-api/compare/v0.6.3...v0.7.0
33
38
  [0.6.3]: https://github.com/accodeing/fortnox-api/compare/v0.6.2...v0.6.3
@@ -41,6 +41,10 @@ module Fortnox
41
41
  AccountNumber = Strict::Int
42
42
  .constrained(gteq: 0, lteq: 9999)
43
43
  .optional
44
+ .constructor do |value|
45
+ next nil if value.nil? || value == ''
46
+ value
47
+ end
44
48
 
45
49
  ArticleType = Strict::String
46
50
  .constrained(included_in: ArticleTypes.values)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fortnox
4
4
  module API
5
- VERSION = '0.7.1'
5
+ VERSION = '0.7.2'
6
6
  end
7
7
  end
@@ -7,25 +7,29 @@ require 'fortnox/api/types/examples/types'
7
7
  describe Fortnox::API::Types do
8
8
  let(:klass) { Fortnox::API::Types::AccountNumber }
9
9
 
10
- context 'when AccountNumber created with nil' do
11
- subject { klass[nil] }
10
+ describe 'AccountNumber' do
11
+ context 'when created with nil' do
12
+ subject { klass[nil] }
12
13
 
13
- it { is_expected.to be_nil }
14
- end
14
+ it { is_expected.to be_nil }
15
+ end
15
16
 
16
- context 'when AccountNumber created with empty string' do
17
- include_examples 'raises ConstraintError', ''
18
- end
17
+ context 'when created with empty string' do
18
+ subject { klass[''] }
19
19
 
20
- context 'when AccountNumber created with valid number' do
21
- include_examples 'equals input', 1234
22
- end
20
+ it { is_expected.to be_nil }
21
+ end
23
22
 
24
- context 'when AccountNumber created with a too large number' do
25
- include_examples 'raises ConstraintError', 10_000
26
- end
23
+ context 'when created with valid number' do
24
+ include_examples 'equals input', 1234
25
+ end
26
+
27
+ context 'when created with a too large number' do
28
+ include_examples 'raises ConstraintError', 10_000
29
+ end
27
30
 
28
- context 'when AccountNumber created with a negative number' do
29
- include_examples 'raises ConstraintError', -1
31
+ context 'when created with a negative number' do
32
+ include_examples 'raises ConstraintError', -1
33
+ end
30
34
  end
31
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortnox-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Schubert Erlandsson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-09-05 00:00:00.000000000 Z
13
+ date: 2019-10-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: countries