unidom-product 1.7.5 → 1.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rspec/models/unidom/product/concerns/as_target_product_shared_examples.rb +23 -0
- data/lib/rspec/models/unidom/product/product_spec.rb +4 -0
- data/lib/unidom/product/rspec_shared_examples.rb +2 -1
- data/lib/unidom/product/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f993080afa9d9dc103a18ea6ff3c7525d3377a1
|
4
|
+
data.tar.gz: c64047c0d8f6e667de20ecd3b03fc978dae8352f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 581d43e50c2eb214df1ec045d689e29ede91ae4a1c6d7105bed01476a97e93d1849532a2b6fc92cb3ab892a99786adc55c9b521e335de37b40ae98ae96451d66
|
7
|
+
data.tar.gz: b53789ef39c59f09939fdd1bda46bab7571239453238a11a930d10843a54bee16605c44f00f1293b4860ea6fe90d7dda3f6a39bccfd7fdc0c765680e6fb52ab9
|
data/README.md
CHANGED
@@ -139,7 +139,7 @@ require 'unidom/product/validators_rspec'
|
|
139
139
|
### RSpec shared examples (to be integrated)
|
140
140
|
|
141
141
|
```ruby
|
142
|
-
# The Unidom::Product::Product model already include the Unidom::Product::Concerns::AsSourceProduct concern
|
142
|
+
# The Unidom::Product::Product model already include the Unidom::Product::Concerns::AsSourceProduct concern, & the Unidom::Product::Concerns::AsSourceProduct concern
|
143
143
|
|
144
144
|
# spec/support/unidom_rspec_shared_examples.rb
|
145
145
|
require 'unidom/prooduct/rspec_shared_examples'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
shared_examples 'Unidom::Product::Concerns::AsTargetProduct' do |model_attributes|
|
2
|
+
|
3
|
+
context do
|
4
|
+
|
5
|
+
source_product_associating_1_attribtues = {
|
6
|
+
source_id: SecureRandom.uuid,
|
7
|
+
product_association_code: 'CPLM',
|
8
|
+
ordinal: 1,
|
9
|
+
quantity: 1
|
10
|
+
}
|
11
|
+
|
12
|
+
source_product_associating_2_attribtues = {
|
13
|
+
source_id: SecureRandom.uuid,
|
14
|
+
product_association_code: 'ICPT',
|
15
|
+
ordinal: 2,
|
16
|
+
quantity: 2
|
17
|
+
}
|
18
|
+
|
19
|
+
it_behaves_like 'has_many', model_attributes, :source_product_associatings, Unidom::Product::ProductAssociating, [ source_product_associating_1_attribtues, source_product_associating_2_attribtues ]
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'rspec/models/unidom/product/concerns/as_source_product_shared_examples'
|
2
|
+
require 'rspec/models/unidom/product/concerns/as_target_product_shared_examples'
|
3
|
+
|
1
4
|
describe Unidom::Product::Product, type: :model do
|
2
5
|
|
3
6
|
before :each do
|
@@ -18,6 +21,7 @@ describe Unidom::Product::Product, type: :model do
|
|
18
21
|
|
19
22
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
20
23
|
it_behaves_like 'Unidom::Product::Concerns::AsSourceProduct', model_attributes
|
24
|
+
it_behaves_like 'Unidom::Product::Concerns::AsTargetProduct', model_attributes
|
21
25
|
|
22
26
|
it_behaves_like 'validates text', model_attributes, :name,
|
23
27
|
length: 2..described_class.columns_hash['name'].limit
|
@@ -1 +1,2 @@
|
|
1
|
-
require 'rspec/models/unidom/product/concerns/as_source_product_shared_examples'
|
1
|
+
#require 'rspec/models/unidom/product/concerns/as_source_product_shared_examples'
|
2
|
+
#require 'rspec/models/unidom/product/concerns/as_target_product_shared_examples'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-product
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.6
|
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-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- db/migrate/20020201000000_create_unidom_products.rb
|
60
60
|
- db/migrate/20020211000000_create_unidom_product_associatings.rb
|
61
61
|
- lib/rspec/models/unidom/product/concerns/as_source_product_shared_examples.rb
|
62
|
+
- lib/rspec/models/unidom/product/concerns/as_target_product_shared_examples.rb
|
62
63
|
- lib/rspec/models/unidom/product/product_associating_spec.rb
|
63
64
|
- lib/rspec/models/unidom/product/product_spec.rb
|
64
65
|
- lib/rspec/types/unidom/product/formset_spec.rb
|