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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be31fc29fc8264f8ec170e10cefa779e194cdef2
4
- data.tar.gz: 5d9e227e750ea6cdf79f74de4c74d34c172e3f92
3
+ metadata.gz: 2f993080afa9d9dc103a18ea6ff3c7525d3377a1
4
+ data.tar.gz: c64047c0d8f6e667de20ecd3b03fc978dae8352f
5
5
  SHA512:
6
- metadata.gz: c147882f9338bd9d11dec4bf5a54c8e6cb85d45c2b32382becd8a3ace47e36f879c669ecd5f8c357031071349e09f52271a39cdf84d4b1e25876aa69a2edb698
7
- data.tar.gz: 7150ae492c84d9a65934864643069a5cc403a695f679964890fbe6b73adcbbe83e56d80ce468c5451d8ca238f05e5a8cd2b5b1d8a5abf2572f455f4a8418f029
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'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Product
3
- VERSION = '1.7.5'.freeze
3
+ VERSION = '1.7.6'.freeze
4
4
  end
5
5
  end
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.5
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-03-26 00:00:00.000000000 Z
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