unidom-shopping 1.7.6 → 1.7.7

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: 922ae84a2f71b54a02ffe525a24b976b6abe6e1c
4
- data.tar.gz: f4aa840cde43050c52c0d8072b79f23263e33a8f
3
+ metadata.gz: fad12157f35160f38a4612e987bbbf9d7c359727
4
+ data.tar.gz: c1c86f859f2000ed8bdbed9dc7b97d3bdf135b8a
5
5
  SHA512:
6
- metadata.gz: a730aa34bf4b02b14798410e070c47ca8f5818c4265337eea3c1dbb3f40d213043edf89212324083e9a84b3c65030541c9c76653e8c6923389b9131b99f49fad
7
- data.tar.gz: 408a75ebb7af70c4a20551556048114cb200ec3d34bea8a93e74fe6a7aa8c8d04a9c8812a9c803a5ffe1d73e6c6b30f99b8c19838cae90379e0aedaff2aedee3
6
+ metadata.gz: a718e6ddca9eda138882f5ee21ca7dc4e552eefb49dd3e83d4797b183f987d65f211e480886295eff8e0d2e2974439a02c06fea132bf121b75e72ecc7080342f
7
+ data.tar.gz: ea7f772ab9c5748009a7d93260ca5d6b4367f85b9bee476293562b785a09755909f09d192f226612bbbdff77f023f93a8984525d5ce97558881d3adb9cebe9b1
data/README.md CHANGED
@@ -134,6 +134,10 @@ require 'unidom/shopping/validators_rspec'
134
134
  # lib/unidom.rb
135
135
  def initialize_unidom
136
136
 
137
+ Unidom::Party::Person.class_eval do
138
+ include Unidom::Shopping::Concerns::AsCartShopper
139
+ end
140
+
137
141
  Unidom::Party::Shop.class_eval do
138
142
  include Unidom::Shopping::Concerns::AsShop
139
143
  end
@@ -151,6 +155,21 @@ initialize_unidom
151
155
  # spec/support/unidom_rspec_shared_examples.rb
152
156
  require 'unidom/shopping/rspec_shared_examples'
153
157
 
158
+ # spec/models/unidom/party/person_spec.rb
159
+ describe Unidom::Party::Person, type: :model do
160
+
161
+ context do
162
+
163
+ model_attribtues = {
164
+ name: 'Tim'
165
+ }
166
+
167
+ it_behaves_like 'Unidom::Shopping::Concerns::AsCartShopper', model_attribtues
168
+
169
+ end
170
+
171
+ end
172
+
154
173
  # spec/models/unidom/party/shop_spec.rb
155
174
  describe Unidom::Party::Shop, type: :model do
156
175
 
@@ -0,0 +1,19 @@
1
+ shared_examples 'Unidom::Shopping::Concerns::AsCartShopper' do |model_attributes|
2
+
3
+ context do
4
+
5
+ shopping_cart_1_attributes = {
6
+ shop_id: SecureRandom.uuid,
7
+ shop_type: 'Unidom::Shopping::Shop::Mock'
8
+ }
9
+
10
+ shopping_cart_2_attributes = {
11
+ shop_id: SecureRandom.uuid,
12
+ shop_type: 'Unidom::Shopping::Shop::Mock'
13
+ }
14
+
15
+ it_behaves_like 'has_many', model_attributes, :shopping_carts, Unidom::Shopping::ShoppingCart, [ shopping_cart_1_attributes, shopping_cart_2_attributes ]
16
+
17
+ end
18
+
19
+ end
@@ -1,2 +1,3 @@
1
+ require 'rspec/models/unidom/shopping/concerns/as_cart_shopper_shared_examples'
1
2
  require 'rspec/models/unidom/shopping/concerns/as_shop_shared_examples'
2
3
  require 'rspec/models/unidom/shopping/concerns/as_shopped_shared_examples'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Shopping
3
- VERSION = '1.7.6'.freeze
3
+ VERSION = '1.7.7'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-shopping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.6
4
+ version: 1.7.7
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-04-01 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -54,6 +54,7 @@ files:
54
54
  - config/routes.rb
55
55
  - db/migrate/20020501000000_create_unidom_shopping_carts.rb
56
56
  - db/migrate/20020502000000_create_unidom_shopping_items.rb
57
+ - lib/rspec/models/unidom/shopping/concerns/as_cart_shopper_shared_examples.rb
57
58
  - lib/rspec/models/unidom/shopping/concerns/as_shop_shared_examples.rb
58
59
  - lib/rspec/models/unidom/shopping/concerns/as_shopped_shared_examples.rb
59
60
  - lib/rspec/models/unidom/shopping/shopping_cart_spec.rb