unidom-dictionary 0.3.1 → 0.3.2

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: 3ea3270b618df8759507840edecbb4166b54250f
4
- data.tar.gz: 3556c8b474b43ac9301669524bca12341ab7157b
3
+ metadata.gz: 1458f638496af9c03b61838398c50facaac7f629
4
+ data.tar.gz: 7a92e1700cd66349dec8abfff78d06257f88c9d6
5
5
  SHA512:
6
- metadata.gz: 9a1583405e494e835dd70406e33890767237f81abc0dccfed0f88b4b554af1a9a3432e1b30f96a0374dbdb8d3ddc2a621d9b6b8d5e58a9c891db538656558581
7
- data.tar.gz: bcb2ff6d5050b7a58f652a631e546336b47418327e188a3f7dfced5cbeae47baf05f9180183d1670fca49495540eac1fb42a4b69ef64e1a4cb20f5df1388d469
6
+ metadata.gz: 2b35ed604a72048bf1fb10b44b2672abbf98c464ceb6051b046a44d19fc614d4bb772a76e6d91c770fc2108b80cb563d66ea35db9d965510858e6be358d3d940
7
+ data.tar.gz: a3f84b12ecec510e7ac85b231f85029a785e7eaed30da8c6d906e10e51d36c2d6834df0b4d4151cfd5b541d245d63d6ab82bd2ecdd8cfde81cb990ea3d050cbd
@@ -16,37 +16,14 @@ describe Unidom::Dictionary::DictionaryItem, type: :model do
16
16
 
17
17
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
18
18
 
19
- it_behaves_like 'validates', model_attributes, :dictionary_code,
20
- { } => 0,
21
- { dictionary_code: nil } => 2,
22
- { dictionary_code: '' } => 2,
23
- { dictionary_code: 'A' } => 1,
24
- { dictionary_code: 'AA' } => 1,
25
- { dictionary_code: 'AAA' } => 1,
26
- { dictionary_code: 'AAAA' } => 0,
27
- { dictionary_code: 'AAAAA' } => 1
28
-
29
- it_behaves_like 'validates', model_attributes, :code,
30
- { } => 0,
31
- { code: nil } => 0,
32
- { code: '' } => 0,
33
- { code: 'A' } => 0,
34
- { code: 'AA' } => 0,
35
- { code: 'AAA' } => 0,
36
- { code: 'A'*63 } => 0,
37
- { code: 'A'*64 } => 0,
38
- { code: 'A'*65 } => 1
39
-
40
- it_behaves_like 'validates', model_attributes, :value,
41
- { } => 0,
42
- { value: nil } => 2,
43
- { value: '' } => 2,
44
- { value: 'A' } => 1,
45
- { value: 'AA' } => 0,
46
- { value: 'AAA' } => 0,
47
- { value: 'A'*199 } => 0,
48
- { value: 'A'*200 } => 0,
49
- { value: 'A'*201 } => 1
19
+ it_behaves_like 'validates text', model_attributes, :dictionary_code,
20
+ length: described_class.columns_hash['dictionary_code'].limit..described_class.columns_hash['dictionary_code'].limit
21
+
22
+ it_behaves_like 'validates text', model_attributes, :code,
23
+ length: 1..described_class.columns_hash['code'].limit, allow_blank: true
24
+
25
+ it_behaves_like 'validates text', model_attributes, :value,
26
+ length: 2..described_class.columns_hash['value'].limit
50
27
 
51
28
  end
52
29
 
File without changes
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Dictionary
3
- VERSION = '0.3.1'.freeze
3
+ VERSION = '0.3.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
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-14 00:00:00.000000000 Z
11
+ date: 2017-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -53,6 +53,7 @@ files:
53
53
  - lib/unidom/dictionary.rb
54
54
  - lib/unidom/dictionary/engine.rb
55
55
  - lib/unidom/dictionary/models_rspec.rb
56
+ - lib/unidom/dictionary/rspec_shared_examples.rb
56
57
  - lib/unidom/dictionary/types_rspec.rb
57
58
  - lib/unidom/dictionary/validators_rspec.rb
58
59
  - lib/unidom/dictionary/version.rb