unidom-certificate-china 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/unidom/certificate/china/application_helper.rb +1 -3
- data/lib/rspec/models/unidom/certificate/china/business_license_spec.rb +37 -0
- data/lib/rspec/models/unidom/certificate/china/identity_card_spec.rb +19 -0
- data/lib/unidom/certificate/china/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: 7b8872085abe278128286948eba3f331ecd586e2
|
4
|
+
data.tar.gz: ba4e4654f0f20911a6d932c4476147a8ce15c312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cddbaecb2ccd4f93b2da80758fc8310167bf011b7ae1cf811ee94745fe595e3a52145d65dfb6a2a2ca7b3c1e5deeb4b924f27e0a98a851143c9d983463bb3eb9
|
7
|
+
data.tar.gz: baa1c2bd41b917302c8fd5cc8ae923a11c72fc24bd791c6891398e8f7f5b83b1100e32c0b65d6c84c286f8ceb0c05f018191bab2aabf0bfb67d5268e8d436535
|
@@ -19,8 +19,45 @@ describe Unidom::Certificate::China::BusinessLicense, type: :model do
|
|
19
19
|
validity_thru_date: Date.current+10.years
|
20
20
|
}
|
21
21
|
|
22
|
+
registration_number_max_length = described_class.columns_hash['registration_number'].limit
|
23
|
+
unified_social_credit_identifier_max_length = described_class.columns_hash['unified_social_credit_identifier'].limit
|
24
|
+
|
22
25
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
23
26
|
|
27
|
+
it_behaves_like 'validates', model_attributes, :registration_number,
|
28
|
+
{ } => 0,
|
29
|
+
{ registration_number: nil } => 0,
|
30
|
+
{ registration_number: '' } => 0,
|
31
|
+
{ registration_number: '1' } => 2,
|
32
|
+
{ registration_number: 'A' } => 3,
|
33
|
+
{ registration_number: '11' } => 2,
|
34
|
+
{ registration_number: 'AA' } => 3,
|
35
|
+
{ registration_number: '111' } => 2,
|
36
|
+
{ registration_number: 'AAA' } => 3,
|
37
|
+
{ registration_number: '1'*(registration_number_max_length-1) } => 2,
|
38
|
+
{ registration_number: 'A'*(registration_number_max_length-1) } => 3,
|
39
|
+
{ registration_number: '1'*registration_number_max_length } => 0,
|
40
|
+
{ registration_number: 'A'*registration_number_max_length } => 2,
|
41
|
+
{ registration_number: '1'*(registration_number_max_length+1) } => 2,
|
42
|
+
{ registration_number: 'A'*(registration_number_max_length+1) } => 3
|
43
|
+
|
44
|
+
it_behaves_like 'validates', model_attributes, :unified_social_credit_identifier,
|
45
|
+
{ } => 0,
|
46
|
+
{ unified_social_credit_identifier: nil } => 0,
|
47
|
+
{ unified_social_credit_identifier: '' } => 0,
|
48
|
+
{ unified_social_credit_identifier: '1' } => 1,
|
49
|
+
{ unified_social_credit_identifier: 'A' } => 1,
|
50
|
+
{ unified_social_credit_identifier: '11' } => 1,
|
51
|
+
{ unified_social_credit_identifier: 'AA' } => 1,
|
52
|
+
{ unified_social_credit_identifier: '111' } => 1,
|
53
|
+
{ unified_social_credit_identifier: 'AAA' } => 1,
|
54
|
+
{ unified_social_credit_identifier: '1'*(unified_social_credit_identifier_max_length-1) } => 1,
|
55
|
+
{ unified_social_credit_identifier: 'A'*(unified_social_credit_identifier_max_length-1) } => 1,
|
56
|
+
{ unified_social_credit_identifier: '1'*unified_social_credit_identifier_max_length } => 0,
|
57
|
+
{ unified_social_credit_identifier: 'A'*unified_social_credit_identifier_max_length } => 0,
|
58
|
+
{ unified_social_credit_identifier: '1'*(unified_social_credit_identifier_max_length+1) } => 1,
|
59
|
+
{ unified_social_credit_identifier: 'A'*(unified_social_credit_identifier_max_length+1) } => 1
|
60
|
+
|
24
61
|
end
|
25
62
|
|
26
63
|
end
|
@@ -20,8 +20,27 @@ describe Unidom::Certificate::China::IdentityCard, type: :model do
|
|
20
20
|
validity_thru_date: Date.current+10.years
|
21
21
|
}
|
22
22
|
|
23
|
+
identification_number_max_length = described_class.columns_hash['identification_number'].limit
|
24
|
+
|
23
25
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
24
26
|
|
27
|
+
it_behaves_like 'validates', model_attributes, :identification_number,
|
28
|
+
{ } => 0,
|
29
|
+
{ identification_number: nil } => 3,
|
30
|
+
{ identification_number: '' } => 3,
|
31
|
+
{ identification_number: '1' } => 2,
|
32
|
+
{ identification_number: 'A' } => 2,
|
33
|
+
{ identification_number: '11' } => 2,
|
34
|
+
{ identification_number: 'AA' } => 2,
|
35
|
+
{ identification_number: '111' } => 2,
|
36
|
+
{ identification_number: 'AAA' } => 2,
|
37
|
+
{ identification_number: '1'*(identification_number_max_length-1) } => 2,
|
38
|
+
{ identification_number: 'A'*(identification_number_max_length-1) } => 2,
|
39
|
+
{ identification_number: '1'*identification_number_max_length } => 0,
|
40
|
+
{ identification_number: 'A'*identification_number_max_length } => 1,
|
41
|
+
{ identification_number: '1'*(identification_number_max_length+1) } => 2,
|
42
|
+
{ identification_number: 'A'*(identification_number_max_length+1) } => 2
|
43
|
+
|
25
44
|
end
|
26
45
|
|
27
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-certificate-china
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
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-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-certificate
|