unidom-shopping 1.7.4 → 1.7.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18b8f79a6b53a4c46f71f1853edcf0f71f0eafc3
|
4
|
+
data.tar.gz: 9ab723541b47c75228ba140165d6357bb20c6a43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7bfa44364fb61b8745398e9df8c8f874df95a278ec5bc9cadf003b7cf58226c44df76ef438c6b008c11effb69a521ad651ae540778fecc3412f6ffe4f5dcff2
|
7
|
+
data.tar.gz: cf160c2906ca0a49ecca2cd8289b98ba72c7ea31874327ec62cf92b991fa35b13dbc93690c765d5bb16fb52c5e14dcd6a1ade78694d0f41fcb181e3cea2197aa
|
data/README.md
CHANGED
@@ -115,6 +115,8 @@ end
|
|
115
115
|
|
116
116
|
## RSpec examples
|
117
117
|
|
118
|
+
### RSpec example manifest (run automatically)
|
119
|
+
|
118
120
|
```ruby
|
119
121
|
# spec/models/unidom_spec.rb
|
120
122
|
require 'unidom/shopping/models_rspec'
|
@@ -125,3 +127,34 @@ require 'unidom/shopping/types_rspec'
|
|
125
127
|
# spec/validators/unidom_spec.rb
|
126
128
|
require 'unidom/shopping/validators_rspec'
|
127
129
|
```
|
130
|
+
|
131
|
+
### RSpec shared examples (to be integrated)
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
# lib/unidom.rb
|
135
|
+
def initialize_unidom
|
136
|
+
|
137
|
+
Unidom::Party::Shop.class_eval do
|
138
|
+
include Unidom::Shopping::Concerns::AsShop
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
# spec/rails_helper.rb
|
144
|
+
require 'unidom'
|
145
|
+
initialize_unidom
|
146
|
+
|
147
|
+
# spec/support/unidom_rspec_shared_examples.rb
|
148
|
+
require 'unidom/shopping/rspec_shared_examples'
|
149
|
+
|
150
|
+
# spec/models/unidom/party/shop_spec.rb
|
151
|
+
describe Unidom::Party::Shop do
|
152
|
+
|
153
|
+
model_attribtues = {
|
154
|
+
name: 'WalMart'
|
155
|
+
}
|
156
|
+
|
157
|
+
it_behaves_like 'Unidom::Shopping::Concerns::AsShop', model_attribtues
|
158
|
+
|
159
|
+
end
|
160
|
+
```
|
@@ -0,0 +1,19 @@
|
|
1
|
+
shared_examples 'Unidom::Shopping::Concerns::AsShop' do |model_attributes|
|
2
|
+
|
3
|
+
context do
|
4
|
+
|
5
|
+
shopping_cart_1_attributes = {
|
6
|
+
shopper_id: SecureRandom.uuid,
|
7
|
+
shopper_type: 'Unidom::Shopping::Shopper'
|
8
|
+
}
|
9
|
+
|
10
|
+
shopping_cart_2_attributes = {
|
11
|
+
shopper_id: SecureRandom.uuid,
|
12
|
+
shopper_type: 'Unidom::Shopping::Shopper'
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'rspec/models/unidom/shopping/concerns/as_shop_shared_examples'
|
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.
|
4
|
+
version: 1.7.5
|
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-
|
11
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -54,12 +54,14 @@ 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_shop_shared_examples.rb
|
57
58
|
- lib/rspec/models/unidom/shopping/shopping_cart_spec.rb
|
58
59
|
- lib/rspec/models/unidom/shopping/shopping_item_spec.rb
|
59
60
|
- lib/tasks/shopping_tasks.rake
|
60
61
|
- lib/unidom/shopping.rb
|
61
62
|
- lib/unidom/shopping/engine.rb
|
62
63
|
- lib/unidom/shopping/models_rspec.rb
|
64
|
+
- lib/unidom/shopping/rspec_shared_examples.rb
|
63
65
|
- lib/unidom/shopping/types_rspec.rb
|
64
66
|
- lib/unidom/shopping/validators_rspec.rb
|
65
67
|
- lib/unidom/shopping/version.rb
|