unidom-order 1.5.7 → 1.5.8

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: 12cacfafcbbcc51b5238c24605c0b5948663d03a
4
- data.tar.gz: f6011e5192b4daa6a704aef036efb415684f9450
3
+ metadata.gz: db0f1360aecd050dea37dd389eb4898a21008691
4
+ data.tar.gz: 8346921528890bea61e6407248f51d66876c748b
5
5
  SHA512:
6
- metadata.gz: 284e81d39db701cf08269d0440a1d0b66716b9d4e879a188a6c65a93c580b998d10b8c5d53b87e52424cb7792a3502c8d57522badd855d9ceeba5c69e9418576
7
- data.tar.gz: d38febdb15f38164ed736004ff699d68bea77684a891d79b7b6ab472b2c9b52bb6926cd63081d2c6560d63332eb69960959d3b61ecf77cc3dcf59a3915bb2fa8
6
+ metadata.gz: aaab80bbcaf6d8349c015577a99c4e4794d92f6a181a850231529e696ca61901be0f8e6ddbb16e1c7d9c45ee6ecfec4c8dc1c44aacb058a72c9b2240c56e8ad9
7
+ data.tar.gz: 17d0debda693bc7dcdea878bba996338303d31e938e400a84ec08d2a5506775c9f806adb32953e51a3b95f846c076746434fa2c9c5f741191bba3fd9f1113d47
data/README.md CHANGED
@@ -192,6 +192,12 @@ Unidom::Party::Person.class_eval do
192
192
 
193
193
  end
194
194
 
195
+ Unidom::Party::Shop.class_eval do
196
+
197
+ include Unidom::Order::Concerns::AsOrderTaker
198
+
199
+ end
200
+
195
201
  # spec/support/unidom_rspec_shared_examples.rb
196
202
  require 'unidom/order/rspec_shared_examples'
197
203
 
@@ -200,5 +206,12 @@ describe Unidom::Party::Person, type: :model do
200
206
 
201
207
  it_behaves_like 'Unidom::Order::Concerns::AsOrderPlacer', model_attributes
202
208
 
209
+ end
210
+
211
+ # spec/models/unidom/party/shop_spec.rb
212
+ describe Unidom::Party::Shop, type: :model do
213
+
214
+ it_behaves_like 'Unidom::Order::Concerns::AsOrderTaker', model_attributes
215
+
203
216
  end
204
217
  ```
@@ -0,0 +1,25 @@
1
+ shared_examples 'Unidom::Order::Concerns::AsOrderTaker' do |model_attributes|
2
+
3
+ context do
4
+
5
+ order_1_attributes = {
6
+ placer_id: SecureRandom.uuid,
7
+ placer_type: 'Unidom::Order::Placer::Mock',
8
+ number: SecureRandom.hex(6),
9
+ purchase_amount: 10.00,
10
+ aggregate_amount: 10.00
11
+ }
12
+
13
+ order_1_attributes = {
14
+ placer_id: SecureRandom.uuid,
15
+ placer_type: 'Unidom::Order::Placer::Mock',
16
+ number: SecureRandom.hex(6),
17
+ purchase_amount: 20.00,
18
+ aggregate_amount: 20.00
19
+ }
20
+
21
+ it_behaves_like 'has_many', model_attributes, :taken_orders, Unidom::Order::Order, [ order_1_attributes, order_1_attributes ]
22
+
23
+ end
24
+
25
+ end
@@ -1 +1,2 @@
1
1
  require 'rspec/models/unidom/order/concerns/as_order_placer_shared_examples'
2
+ require 'rspec/models/unidom/order/concerns/as_order_taker_shared_examples'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Order
3
- VERSION = '1.5.7'.freeze
3
+ VERSION = '1.5.8'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-order
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.7
4
+ version: 1.5.8
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-11 00:00:00.000000000 Z
11
+ date: 2017-04-17 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/20020602000000_create_unidom_order_items.rb
60
60
  - db/migrate/20020603000000_create_unidom_order_adjustments.rb
61
61
  - lib/rspec/models/unidom/order/concerns/as_order_placer_shared_examples.rb
62
+ - lib/rspec/models/unidom/order/concerns/as_order_taker_shared_examples.rb
62
63
  - lib/rspec/models/unidom/order/order_adjustment_spec.rb
63
64
  - lib/rspec/models/unidom/order/order_item_spec.rb
64
65
  - lib/rspec/models/unidom/order/order_spec.rb