unidom-order 1.5.6 → 1.5.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: c5c3bfc09e3b888292b6148bee326d99bcecfffa
4
- data.tar.gz: dd0714bbe35e4e9f06207add90aac766ddb09425
3
+ metadata.gz: 12cacfafcbbcc51b5238c24605c0b5948663d03a
4
+ data.tar.gz: f6011e5192b4daa6a704aef036efb415684f9450
5
5
  SHA512:
6
- metadata.gz: bdc23e284f05a35246495d3af7923b243a93dcb1b1232e541f2d67724c3dc342766a8b377d10dfb533cb7a82097c2764a76c7f875a9c1514d504289f7c0a3435
7
- data.tar.gz: 2d1431fb93c6f974ddfc51bc806ef12c74845118e3e2a32da4c4366e73ff764cb26fa7c08ac83f4f31c9a2f183ec424cbc83d4fe26a8e32709c095a95e7b26c3
6
+ metadata.gz: 284e81d39db701cf08269d0440a1d0b66716b9d4e879a188a6c65a93c580b998d10b8c5d53b87e52424cb7792a3502c8d57522badd855d9ceeba5c69e9418576
7
+ data.tar.gz: d38febdb15f38164ed736004ff699d68bea77684a891d79b7b6ab472b2c9b52bb6926cd63081d2c6560d63332eb69960959d3b61ecf77cc3dcf59a3915bb2fa8
data/README.md CHANGED
@@ -169,6 +169,8 @@ end
169
169
 
170
170
  ## RSpec examples
171
171
 
172
+ ### RSpec example manifest (run automatically)
173
+
172
174
  ```ruby
173
175
  # spec/models/unidom_spec.rb
174
176
  require 'unidom/order/models_rspec'
@@ -179,3 +181,24 @@ require 'unidom/order/types_rspec'
179
181
  # spec/validators/unidom_spec.rb
180
182
  require 'unidom/order/validators_rspec'
181
183
  ```
184
+
185
+ ### RSpec shared examples (to be integrated)
186
+
187
+ ```ruby
188
+ # lib/unidom.rb
189
+ Unidom::Party::Person.class_eval do
190
+
191
+ include Unidom::Order::Concerns::AsOrderPlacer
192
+
193
+ end
194
+
195
+ # spec/support/unidom_rspec_shared_examples.rb
196
+ require 'unidom/order/rspec_shared_examples'
197
+
198
+ # spec/models/unidom/party/person_spec.rb
199
+ describe Unidom::Party::Person, type: :model do
200
+
201
+ it_behaves_like 'Unidom::Order::Concerns::AsOrderPlacer', model_attributes
202
+
203
+ end
204
+ ```
@@ -0,0 +1,25 @@
1
+ shared_examples 'Unidom::Order::Concerns::AsOrderPlacer' do |model_attributes|
2
+
3
+ context do
4
+
5
+ order_1_attributes = {
6
+ taker_id: SecureRandom.uuid,
7
+ taker_type: 'Unidom::Order::Taker::Mock',
8
+ number: SecureRandom.hex(6),
9
+ purchase_amount: 10.00,
10
+ aggregate_amount: 10.00
11
+ }
12
+
13
+ order_1_attributes = {
14
+ taker_id: SecureRandom.uuid,
15
+ taker_type: 'Unidom::Order::Taker::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, :placed_orders, Unidom::Order::Order, [ order_1_attributes, order_1_attributes ]
22
+
23
+ end
24
+
25
+ end
@@ -0,0 +1 @@
1
+ require 'rspec/models/unidom/order/concerns/as_order_placer_shared_examples'
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Order
3
- VERSION = '1.5.6'.freeze
3
+ VERSION = '1.5.7'.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.6
4
+ version: 1.5.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-03 00:00:00.000000000 Z
11
+ date: 2017-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -58,6 +58,7 @@ files:
58
58
  - db/migrate/20020601000000_create_unidom_orders.rb
59
59
  - db/migrate/20020602000000_create_unidom_order_items.rb
60
60
  - db/migrate/20020603000000_create_unidom_order_adjustments.rb
61
+ - lib/rspec/models/unidom/order/concerns/as_order_placer_shared_examples.rb
61
62
  - lib/rspec/models/unidom/order/order_adjustment_spec.rb
62
63
  - lib/rspec/models/unidom/order/order_item_spec.rb
63
64
  - lib/rspec/models/unidom/order/order_spec.rb
@@ -66,6 +67,7 @@ files:
66
67
  - lib/unidom/order.rb
67
68
  - lib/unidom/order/engine.rb
68
69
  - lib/unidom/order/models_rspec.rb
70
+ - lib/unidom/order/rspec_shared_examples.rb
69
71
  - lib/unidom/order/types_rspec.rb
70
72
  - lib/unidom/order/validators_rspec.rb
71
73
  - lib/unidom/order/version.rb