unidom-standard 1.4 → 1.4.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: cebcbca409ec994550be2208bec440723ea724d1
4
- data.tar.gz: 7daec7f6026996bd27bfd96006ac5a5942676d17
3
+ metadata.gz: 05c558e6dc0b25a2d495c0f5da157597399fe7a3
4
+ data.tar.gz: fe2ab5890489f62da6e0a66094bdcdd7759e8f4e
5
5
  SHA512:
6
- metadata.gz: 2bc63993872b71a8593b9b08a849506bf48af81784bd8ec0047acf81149a688dde24d05c62de2712920bc7248523fdf3830db403d26a70d6935135900a5d5f57
7
- data.tar.gz: d784ced9ab18d70da3a830a9bad586c0fac5b21b4bd388520cad2ea69f7f3b5fa05d99a75cdda750ea90ca4d7692080fb0d7f5206291b1133bccfb2493d92018
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
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Standard
3
- VERSION = '1.4'.freeze
3
+ VERSION = '1.4.1'.freeze
4
4
  end
5
5
  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: '1.4'
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-01 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common