unidom-standard 1.4 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec/models/unidom/standard/standard_spec.rb +25 -0
- data/lib/unidom/standard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c558e6dc0b25a2d495c0f5da157597399fe7a3
|
4
|
+
data.tar.gz: fe2ab5890489f62da6e0a66094bdcdd7759e8f4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1d7ca3c30626e958be11cfd72a21205e4d329cb1afd192867e7db5ef397458655a7f4a9cb8b2fbffd9c4201e30ea2e9162beb57bd52c1eb57ec4a8e2756bf2d
|
7
|
+
data.tar.gz: b7dd1593a614430e5409fe44581893f5a880aeaf88160cdd394bbd774c0856e56b8d566884e92f88c947d09c6d0db25468544c9083470cd37ab75a1f3353c958
|
@@ -17,8 +17,33 @@ describe Unidom::Standard::Standard, type: :model do
|
|
17
17
|
obsoleted_on: Date.current+20.years
|
18
18
|
}
|
19
19
|
|
20
|
+
name_max_length = described_class.columns_hash['name'].limit
|
21
|
+
number_max_length = described_class.columns_hash['number'].limit
|
22
|
+
|
20
23
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
21
24
|
|
25
|
+
it_behaves_like 'validates', model_attributes, :name,
|
26
|
+
{ } => 0,
|
27
|
+
{ name: nil } => 2,
|
28
|
+
{ name: '' } => 2,
|
29
|
+
{ name: 'A' } => 1,
|
30
|
+
{ name: 'AA' } => 0,
|
31
|
+
{ name: 'AAA' } => 0,
|
32
|
+
{ name: 'A'*(name_max_length-1) } => 0,
|
33
|
+
{ name: 'A'*name_max_length } => 0,
|
34
|
+
{ name: 'A'*(name_max_length+1) } => 1
|
35
|
+
|
36
|
+
it_behaves_like 'validates', model_attributes, :number,
|
37
|
+
{ } => 0,
|
38
|
+
{ number: nil } => 2,
|
39
|
+
{ number: '' } => 2,
|
40
|
+
{ number: 'A' } => 1,
|
41
|
+
{ number: 'AA' } => 0,
|
42
|
+
{ number: 'AAA' } => 0,
|
43
|
+
{ number: 'A'*(name_max_length-1) } => 0,
|
44
|
+
{ number: 'A'*name_max_length } => 0,
|
45
|
+
{ number: 'A'*(name_max_length+1) } => 1
|
46
|
+
|
22
47
|
end
|
23
48
|
|
24
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-standard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.4.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-02-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|