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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/fortnox/api/types.rb +4 -0
- data/lib/fortnox/api/version.rb +1 -1
- data/spec/fortnox/api/types/account_number_spec.rb +19 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707b9b050edd8499029c1f2120d11edc923e868847657eb0c108789014a5e3c8
|
4
|
+
data.tar.gz: 7da764b991529e720f3afbbb01433da52ca4f34800951b05c4f0f1e11f646c6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 075e852a210ad2313fcf1c4469cb54a857016d46963e353679f16ea9e5daf09b28857491d9ccdc9b20c2a6843d7bc79093122db5419cf4219f1d830665af27b4
|
7
|
+
data.tar.gz: 35f8989ec19be2bf69c4f703daf54feb8b7d09e4c6bec95455c3483b23e4f8aa74547f781f2874c39d8903761feb769474bba0795ac2b3a21142a27b4ca706dc
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/fortnox/api/types.rb
CHANGED
@@ -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)
|
data/lib/fortnox/api/version.rb
CHANGED
@@ -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
|
-
|
11
|
-
|
10
|
+
describe 'AccountNumber' do
|
11
|
+
context 'when created with nil' do
|
12
|
+
subject { klass[nil] }
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
it { is_expected.to be_nil }
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
end
|
17
|
+
context 'when created with empty string' do
|
18
|
+
subject { klass[''] }
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
end
|
20
|
+
it { is_expected.to be_nil }
|
21
|
+
end
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
-
|
29
|
-
|
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.
|
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-
|
13
|
+
date: 2019-10-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: countries
|