unidom-requirement 0.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7b53065cdcf538e94f941f83198fd87ee0a460d
4
- data.tar.gz: 3925b7e9e99f78a2bcb138c1df5cc568ba0b83e2
3
+ metadata.gz: 435daf43ca285b24fd1b8036bff45653150ab993
4
+ data.tar.gz: 623f8842d96ce22c7347faab25d479e4b14d1e7e
5
5
  SHA512:
6
- metadata.gz: 28f8de54b172c59d2599e945cac004e117e878b2c17904ef1b41a534790cac9894e08af630589a76d62aeafdb1fa57c6010bfbb5b10bd508a9236b463a811453
7
- data.tar.gz: 0c0539ee77a4be005765e169e8b652bb142224c2f1882a3584d0fe3d9607ccec6c072a62a392cf1e481e05fdceb04beb5b160ff398926f3aea78a4849b440fec
6
+ metadata.gz: cba4606273076ed43ed8f41038a618474603a61934798dc5be730e9f6130f8b870d44a635c4bb7a2dd2f642f9d306ba932f5de18db0ce277ff94a334d726b189
7
+ data.tar.gz: 7473ed9ad0f2a1e0538fd5d72b3b6f9fdc2d25e4a2e2e4924c53e8f20b7a01e1eecc02dd995393a56e0c9ed18a649298e6c38950d494f382fb443e9a5245b25b
@@ -26,6 +26,42 @@ describe Unidom::Requirement::Requirement, type: :model do
26
26
 
27
27
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
28
28
 
29
+ it_behaves_like 'validates', model_attributes, :estimated_budget,
30
+ { } => 0,
31
+ { estimated_budget: nil } => 2,
32
+ { estimated_budget: '' } => 2,
33
+ { estimated_budget: 'A' } => 1,
34
+ { estimated_budget: '-0.01' } => 1,
35
+ { estimated_budget: -0.01 } => 1,
36
+ { estimated_budget: 0 } => 1,
37
+ { estimated_budget: '0' } => 1,
38
+ { estimated_budget: 0.01 } => 0,
39
+ { estimated_budget: '0.01' } => 0,
40
+ { estimated_budget: '999_999_999.99' } => 0,
41
+ { estimated_budget: 999_999_999.99 } => 0,
42
+ { estimated_budget: 1_000_000_000 } => 1,
43
+ { estimated_budget: '1_000_000_000' } => 1,
44
+ { estimated_budget: 1_000_000_000.01 } => 1,
45
+ { estimated_budget: '1_000_000_000.01' } => 1
46
+
47
+ it_behaves_like 'validates', model_attributes, :quantity,
48
+ { } => 0,
49
+ { quantity: nil } => 2,
50
+ { quantity: '' } => 2,
51
+ { quantity: 'A' } => 1,
52
+ { quantity: '-0.01' } => 1,
53
+ { quantity: -0.01 } => 1,
54
+ { quantity: 0 } => 1,
55
+ { quantity: '0' } => 1,
56
+ { quantity: 0.01 } => 0,
57
+ { quantity: '0.01' } => 0,
58
+ { quantity: '999_999_999.99' } => 0,
59
+ { quantity: 999_999_999.99 } => 0,
60
+ { quantity: 1_000_000_000 } => 1,
61
+ { quantity: '1_000_000_000' } => 1,
62
+ { quantity: 1_000_000_000.01 } => 1,
63
+ { quantity: '1_000_000_000.01' } => 1
64
+
29
65
  end
30
66
 
31
67
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Requirement
3
- VERSION = '0.3'.freeze
3
+ VERSION = '0.3.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-requirement
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-30 00:00:00.000000000 Z
11
+ date: 2017-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common