unidom-certificate 2.1.1 → 2.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a73ff7033e661adc95265a518af8bd9403cbb0f
|
4
|
+
data.tar.gz: 46aaf1c79c590b9b58023041773086f94e7d0b1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 724fc9aae9f6d1d1057d9e277ff570a067db98cd622bfc14801746fa9db5b4b8ad05cc565131e261ef87e9349badb23789fe249d0a8a79ba45c7ec12d48bc655
|
7
|
+
data.tar.gz: 8b4d343cf611d1a3e63ef66246ac0fdf8c6c87ab812607785d5b8c5e841c4b294f5bf641b83ec03b345c44d5fd088e7c884460d4f6f4cf7ecc5acf2b68eb3ef2
|
data/README.md
CHANGED
@@ -162,24 +162,45 @@ end
|
|
162
162
|
# spec/models/unidom/party/shop_spec.rb
|
163
163
|
describe Unidom::Party::Shop, type: :model do
|
164
164
|
|
165
|
-
|
166
|
-
name: 'WalMart'
|
167
|
-
}
|
165
|
+
context do
|
168
166
|
|
169
|
-
|
167
|
+
model_attribtues = {
|
168
|
+
name: 'WalMart'
|
169
|
+
}
|
170
|
+
|
171
|
+
certification_attributes = {
|
172
|
+
unified_social_credit_identifier: '510105012345678911',
|
173
|
+
name: 'Kaz',
|
174
|
+
address: 'Beijing',
|
175
|
+
legal_representative_name: 'Tim'
|
176
|
+
}
|
177
|
+
certification = Unidom::Certificate::China::BusinessLicense.unified_social_credit_identifier_is(certification_attributes.delete :unified_social_credit_identifier).first_or_create! certification_attributes
|
178
|
+
|
179
|
+
certificator_attributes = {
|
180
|
+
name: 'Tim'
|
181
|
+
}
|
182
|
+
certificator = Unidom::Party::Person.create! certificator_attributes
|
183
|
+
|
184
|
+
it_behaves_like 'Unidom::Certificate::Concerns::AsCertificated', model_attribtues, certification, certificator
|
185
|
+
|
186
|
+
end
|
170
187
|
|
171
188
|
end
|
172
189
|
|
173
190
|
# spec/models/your_certification_spec.rb
|
174
191
|
describe YourCertification, type: :model do
|
175
192
|
|
176
|
-
|
177
|
-
name: 'Your Certification Name',
|
178
|
-
serial_number: '12345678',
|
179
|
-
issued_on: '2020-01-01'
|
180
|
-
}
|
193
|
+
context do
|
181
194
|
|
182
|
-
|
195
|
+
model_attribtues = {
|
196
|
+
name: 'Your Certification Name',
|
197
|
+
serial_number: '12345678',
|
198
|
+
issued_on: '2020-01-01'
|
199
|
+
}
|
200
|
+
|
201
|
+
it_behaves_like 'Unidom::Certificate::Concerns::AsCertification', model_attribtues
|
202
|
+
|
203
|
+
end
|
183
204
|
|
184
205
|
end
|
185
206
|
```
|
@@ -1,4 +1,4 @@
|
|
1
|
-
shared_examples 'Unidom::Certificate::Concerns::AsCertificated' do |model_attributes|
|
1
|
+
shared_examples 'Unidom::Certificate::Concerns::AsCertificated' do |model_attributes, certification, certificator|
|
2
2
|
|
3
3
|
context do
|
4
4
|
|
@@ -18,6 +18,10 @@ shared_examples 'Unidom::Certificate::Concerns::AsCertificated' do |model_attrib
|
|
18
18
|
|
19
19
|
it_behaves_like 'has_many', model_attributes, :certificatings, Unidom::Certificate::Certificating, [ certificating_1_attribtues, certificating_2_attribtues ]
|
20
20
|
|
21
|
+
model = described_class.create! model_attributes
|
22
|
+
it_behaves_like 'assert_present!', model, :is_certificated!, [ certification, { by: certificator, at: Time.now } ], [ { 0 => :certification }, :by, :at ]
|
23
|
+
it_behaves_like 'assert_present!', model, :is_certificated?, [ certification, { at: Time.now } ], [ { 0 => :certification }, :at ]
|
24
|
+
|
21
25
|
end
|
22
26
|
|
23
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-certificate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.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-
|
11
|
+
date: 2017-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|