solidus_backend 1.4.2 → 2.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/admin/option_types_controller.rb +1 -1
  3. data/app/controllers/spree/admin/option_values_controller.rb +1 -1
  4. data/app/controllers/spree/admin/orders_controller.rb +6 -6
  5. data/app/controllers/spree/admin/resource_controller.rb +1 -1
  6. data/app/controllers/spree/admin/return_authorizations_controller.rb +1 -1
  7. data/app/controllers/spree/admin/return_items_controller.rb +2 -1
  8. data/app/controllers/spree/admin/stock_transfers_controller.rb +2 -1
  9. data/app/views/spree/admin/reimbursements/edit.html.erb +1 -1
  10. data/spec/controllers/spree/admin/base_controller_spec.rb +1 -1
  11. data/spec/controllers/spree/admin/cancellations_controller_spec.rb +3 -3
  12. data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +4 -4
  13. data/spec/controllers/spree/admin/missing_products_controller_spec.rb +1 -1
  14. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +5 -5
  15. data/spec/controllers/spree/admin/orders_controller_spec.rb +24 -24
  16. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +4 -4
  17. data/spec/controllers/spree/admin/payments_controller_spec.rb +7 -7
  18. data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -2
  19. data/spec/controllers/spree/admin/product_properties_controller_spec.rb +1 -1
  20. data/spec/controllers/spree/admin/products_controller_spec.rb +5 -5
  21. data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -2
  22. data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +1 -1
  23. data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +2 -2
  24. data/spec/controllers/spree/admin/promotions_controller_spec.rb +5 -5
  25. data/spec/controllers/spree/admin/refunds_controller_spec.rb +5 -3
  26. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +5 -5
  27. data/spec/controllers/spree/admin/reports_controller_spec.rb +1 -1
  28. data/spec/controllers/spree/admin/resource_controller_spec.rb +6 -6
  29. data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +11 -11
  30. data/spec/controllers/spree/admin/return_items_controller_spec.rb +1 -1
  31. data/spec/controllers/spree/admin/search_controller_spec.rb +2 -2
  32. data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +1 -1
  33. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +2 -2
  34. data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +9 -9
  35. data/spec/controllers/spree/admin/store_credits_controller_spec.rb +8 -8
  36. data/spec/controllers/spree/admin/users_controller_spec.rb +23 -23
  37. data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -2
  38. metadata +9 -9
@@ -8,7 +8,7 @@ describe Spree::Admin::ShippingMethodsController, type: :controller do
8
8
  shipping_method = stub_model(Spree::ShippingMethod)
9
9
  allow(Spree::ShippingMethod).to receive_messages find: shipping_method
10
10
  expect(shipping_method.deleted_at).to be_nil
11
- delete :destroy, id: 1
11
+ delete :destroy, params: { id: 1 }
12
12
  expect(shipping_method.reload.deleted_at).not_to be_nil
13
13
  end
14
14
  end
@@ -15,7 +15,7 @@ module Spree
15
15
  before { request.env["HTTP_REFERER"] = "product_admin_page" }
16
16
 
17
17
  subject do
18
- post :create, { variant_id: variant, stock_location_id: stock_location, stock_movement: { quantity: 1, stock_item_id: stock_item.id } }
18
+ post :create, params: { variant_id: variant, stock_location_id: stock_location, stock_movement: { quantity: 1, stock_item_id: stock_item.id } }
19
19
  end
20
20
 
21
21
  it "creates a stock movement with originator" do
@@ -31,7 +31,7 @@ module Spree
31
31
 
32
32
  context "with product_slug param" do
33
33
  it "scopes the variants by the product" do
34
- get :index, product_slug: variant_1.product.slug
34
+ get :index, params: { product_slug: variant_1.product.slug }
35
35
  expect(assigns(:variants)).to include variant_1
36
36
  expect(assigns(:variants)).not_to include variant_2
37
37
  end
@@ -46,18 +46,18 @@ module Spree
46
46
  end
47
47
 
48
48
  it "searches by stock location" do
49
- get :index, q: { source_location_id_or_destination_location_id_eq: ny_store.id }
49
+ get :index, params: { q: { source_location_id_or_destination_location_id_eq: ny_store.id } }
50
50
  expect(assigns(:stock_transfers).count).to eq 1
51
51
  expect(assigns(:stock_transfers)).to include(stock_transfer1)
52
52
  end
53
53
 
54
54
  it "filters the closed stock transfers" do
55
- get :index, q: { closed_at_null: '1' }
55
+ get :index, params: { q: { closed_at_null: '1' } }
56
56
  expect(assigns(:stock_transfers)).to match_array [stock_transfer1]
57
57
  end
58
58
 
59
59
  it "doesn't filter any stock transfers" do
60
- get :index, q: { closed_at_null: '0' }
60
+ get :index, params: { q: { closed_at_null: '0' } }
61
61
  expect(assigns(:stock_transfers)).to match_array [stock_transfer1, stock_transfer2]
62
62
  end
63
63
  end
@@ -66,7 +66,7 @@ module Spree
66
66
  let(:warehouse) { StockLocation.create(name: "Warehouse", active: false) }
67
67
 
68
68
  subject do
69
- post :create, stock_transfer: { source_location_id: warehouse.id, description: nil }
69
+ post :create, params: { stock_transfer: { source_location_id: warehouse.id, description: nil } }
70
70
  end
71
71
 
72
72
  context "user doesn't have read access to the selected stock location" do
@@ -101,7 +101,7 @@ module Spree
101
101
  # Regression spec for Solidus issue #1087
102
102
  context "missing source_stock_location parameter" do
103
103
  subject do
104
- post :create, stock_transfer: { source_location_id: nil, description: nil }
104
+ post :create, params: { stock_transfer: { source_location_id: nil, description: nil } }
105
105
  end
106
106
 
107
107
  it "sets a flash error" do
@@ -118,7 +118,7 @@ module Spree
118
118
  let(:parameters) { { id: transfer_with_items.to_param } }
119
119
 
120
120
  subject do
121
- get :receive, parameters
121
+ get :receive, params: parameters
122
122
  end
123
123
 
124
124
  context 'stock transfer is not receivable' do
@@ -171,7 +171,7 @@ module Spree
171
171
  end
172
172
 
173
173
  subject do
174
- put :finalize, id: transfer_with_items.to_param
174
+ put :finalize, params: { id: transfer_with_items.to_param }
175
175
  end
176
176
 
177
177
  context 'stock transfer is not finalizable' do
@@ -229,7 +229,7 @@ module Spree
229
229
  end
230
230
 
231
231
  subject do
232
- put :close, id: transfer_with_items.to_param
232
+ put :close, params: { id: transfer_with_items.to_param }
233
233
  end
234
234
 
235
235
  context 'stock transfer is not receivable' do
@@ -321,7 +321,7 @@ module Spree
321
321
  let(:warehouse_stock_item) { warehouse.stock_items.find_by(variant: transfer_variant) }
322
322
  let(:ny_stock_item) { ny_store.stock_items.find_by(variant: transfer_variant) }
323
323
 
324
- subject { put :ship, id: stock_transfer.number }
324
+ subject { put :ship, params: { id: stock_transfer.number } }
325
325
 
326
326
  before do
327
327
  warehouse_stock_item.set_count_on_hand(1)
@@ -20,7 +20,7 @@ describe Spree::Admin::StoreCreditsController do
20
20
  let!(:store_credit) { create(:store_credit, user: user, category: a_credit_category) }
21
21
  let!(:event) { create(:store_credit_auth_event, store_credit: store_credit, created_at: 5.days.ago) }
22
22
 
23
- before { get :show, user_id: user.id, id: store_credit.id }
23
+ before { get :show, params: { user_id: user.id, id: store_credit.id } }
24
24
 
25
25
  it "sets the store_credit variable to a new store credit model" do
26
26
  expect(assigns(:store_credit)).to eq store_credit
@@ -33,12 +33,12 @@ describe Spree::Admin::StoreCreditsController do
33
33
  end
34
34
 
35
35
  describe "#new" do
36
- before { get :new, user_id: create(:user).id }
36
+ before { get :new, params: { user_id: create(:user).id } }
37
37
  it { expect(assigns(:credit_categories)).to eq [a_credit_category, b_credit_category] }
38
38
  end
39
39
 
40
40
  describe "#create" do
41
- subject { post :create, parameters }
41
+ subject { post :create, params: parameters }
42
42
 
43
43
  before {
44
44
  allow(controller).to receive_messages(try_spree_current_user: admin_user)
@@ -94,7 +94,7 @@ describe Spree::Admin::StoreCreditsController do
94
94
  describe "#edit_amount" do
95
95
  let!(:store_credit) { create(:store_credit, user: user, category: a_credit_category) }
96
96
 
97
- before { get :edit_amount, user_id: user.id, id: store_credit.id }
97
+ before { get :edit_amount, params: { user_id: user.id, id: store_credit.id } }
98
98
 
99
99
  it_behaves_like "update reason loader"
100
100
 
@@ -106,7 +106,7 @@ describe Spree::Admin::StoreCreditsController do
106
106
  describe "#edit_validity" do
107
107
  let!(:store_credit) { create(:store_credit, user: user, category: a_credit_category) }
108
108
 
109
- before { get :edit_validity, user_id: user.id, id: store_credit.id }
109
+ before { get :edit_validity, params: { user_id: user.id, id: store_credit.id } }
110
110
 
111
111
  it_behaves_like "update reason loader"
112
112
 
@@ -119,7 +119,7 @@ describe Spree::Admin::StoreCreditsController do
119
119
  let(:memo) { "New memo" }
120
120
  let!(:store_credit) { create(:store_credit, user: user) }
121
121
 
122
- subject { put :update, parameters.merge(format: :json) }
122
+ subject { put :update, params: parameters.merge(format: :json) }
123
123
 
124
124
  before { allow(controller).to receive_messages(try_spree_current_user: admin_user) }
125
125
 
@@ -182,7 +182,7 @@ describe Spree::Admin::StoreCreditsController do
182
182
  }
183
183
  end
184
184
 
185
- subject { put :update_amount, parameters }
185
+ subject { put :update_amount, params: parameters }
186
186
 
187
187
  before { allow(controller).to receive_messages(try_spree_current_user: admin_user) }
188
188
 
@@ -272,7 +272,7 @@ describe Spree::Admin::StoreCreditsController do
272
272
  }
273
273
  end
274
274
 
275
- subject { put :invalidate, parameters }
275
+ subject { put :invalidate, params: parameters }
276
276
 
277
277
  it "attempts to invalidate the store credit" do
278
278
  expect { subject }.to change { store_credit.reload.invalidated_at }.from(nil)
@@ -24,7 +24,7 @@ describe Spree::Admin::UsersController, type: :controller do
24
24
  end
25
25
 
26
26
  it "redirects to edit" do
27
- get :show, id: user.id
27
+ get :show, params: { id: user.id }
28
28
  expect(response).to redirect_to spree.edit_admin_user_path(user)
29
29
  end
30
30
  end
@@ -42,7 +42,7 @@ describe Spree::Admin::UsersController, type: :controller do
42
42
 
43
43
  it "allows admins to update a user's API key" do
44
44
  expect {
45
- put :generate_api_key, id: user.id
45
+ put :generate_api_key, params: { id: user.id }
46
46
  }.to change { user.reload.spree_api_key }
47
47
  expect(response).to redirect_to(spree.edit_admin_user_path(user))
48
48
  end
@@ -50,7 +50,7 @@ describe Spree::Admin::UsersController, type: :controller do
50
50
  it "allows admins to clear a user's API key" do
51
51
  user.generate_spree_api_key!
52
52
  expect {
53
- put :clear_api_key, id: user.id
53
+ put :clear_api_key, params: { id: user.id }
54
54
  }.to change{ user.reload.spree_api_key }.to(nil)
55
55
  expect(response).to redirect_to(spree.edit_admin_user_path(user))
56
56
  end
@@ -86,42 +86,42 @@ describe Spree::Admin::UsersController, type: :controller do
86
86
  end
87
87
 
88
88
  it "can create user with roles" do
89
- post :create, { user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
89
+ post :create, params: { user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
90
90
  expect(user.spree_roles).to eq([dummy_role])
91
91
  end
92
92
 
93
93
  it "can create user without roles" do
94
- post :create, { user: { first_name: "Bob" } }
94
+ post :create, params: { user: { first_name: "Bob" } }
95
95
  expect(user.spree_roles).to eq([])
96
96
  end
97
97
  end
98
98
 
99
99
  context "when the user cannot manage roles" do
100
100
  it "cannot assign users roles" do
101
- post :create, { user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
101
+ post :create, params: { user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
102
102
  expect(user.spree_roles).to eq([])
103
103
  end
104
104
 
105
105
  it "can create user without roles" do
106
- post :create, { user: { first_name: "Bob" } }
106
+ post :create, params: { user: { first_name: "Bob" } }
107
107
  expect(user.spree_roles).to eq([])
108
108
  end
109
109
  end
110
110
 
111
111
  it "can create a shipping_address" do
112
- post :create, { user: { ship_address_attributes: valid_address_attributes } }
112
+ post :create, params: { user: { ship_address_attributes: valid_address_attributes } }
113
113
  expect(user.reload.ship_address.city).to eq('New York')
114
114
  end
115
115
 
116
116
  it "can create a billing_address" do
117
- post :create, { user: { bill_address_attributes: valid_address_attributes } }
117
+ post :create, params: { user: { bill_address_attributes: valid_address_attributes } }
118
118
  expect(user.reload.bill_address.city).to eq('New York')
119
119
  end
120
120
 
121
121
  it "can set stock locations" do
122
122
  location = Spree::StockLocation.create(name: "my_location")
123
123
  location_2 = Spree::StockLocation.create(name: "my_location_2")
124
- post :create, { user: { stock_location_ids: [location.id, location_2.id] } }
124
+ post :create, params: { user: { stock_location_ids: [location.id, location_2.id] } }
125
125
  expect(user.stock_locations).to match_array([location, location_2])
126
126
  end
127
127
  end
@@ -142,14 +142,14 @@ describe Spree::Admin::UsersController, type: :controller do
142
142
 
143
143
  it "can set roles" do
144
144
  expect {
145
- put :update, { id: user.id, user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
145
+ put :update, params: { id: user.id, user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
146
146
  }.to change { user.reload.spree_roles.to_a }.to([dummy_role])
147
147
  end
148
148
 
149
149
  it "can clear roles" do
150
150
  user.spree_roles << dummy_role
151
151
  expect {
152
- put :update, { id: user.id, user: { first_name: "Bob", spree_role_ids: [] } }
152
+ put :update, params: { id: user.id, user: { first_name: "Bob", spree_role_ids: [] } }
153
153
  }.to change { user.reload.spree_roles.to_a }.to([])
154
154
  end
155
155
  end
@@ -157,14 +157,14 @@ describe Spree::Admin::UsersController, type: :controller do
157
157
  context "when the user cannot manage roles" do
158
158
  it "cannot set roles" do
159
159
  expect {
160
- put :update, { id: user.id, user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
160
+ put :update, params: { id: user.id, user: { first_name: "Bob", spree_role_ids: [dummy_role.id] } }
161
161
  }.not_to change { user.reload.spree_roles.to_a }
162
162
  end
163
163
 
164
164
  it "cannot clear roles" do
165
165
  user.spree_roles << dummy_role
166
166
  expect {
167
- put :update, { id: user.id, user: { first_name: "Bob" } }
167
+ put :update, params: { id: user.id, user: { first_name: "Bob" } }
168
168
  }.not_to change { user.reload.spree_roles.to_a }
169
169
  end
170
170
  end
@@ -176,7 +176,7 @@ describe Spree::Admin::UsersController, type: :controller do
176
176
 
177
177
  it "can change email of a user" do
178
178
  expect {
179
- put :update, { id: user.id, user: { email: "bob@example.com" } }
179
+ put :update, params: { id: user.id, user: { email: "bob@example.com" } }
180
180
  }.to change { user.reload.email }.to("bob@example.com")
181
181
  end
182
182
  end
@@ -188,25 +188,25 @@ describe Spree::Admin::UsersController, type: :controller do
188
188
 
189
189
  it "cannot change email of a user" do
190
190
  expect {
191
- put :update, { id: user.id, user: { email: "bob@example.com" } }
191
+ put :update, params: { id: user.id, user: { email: "bob@example.com" } }
192
192
  }.not_to change { user.reload.email }
193
193
  end
194
194
  end
195
195
 
196
196
  it "can update ship_address attributes" do
197
- post :update, { id: user.id, user: { ship_address_attributes: valid_address_attributes } }
197
+ post :update, params: { id: user.id, user: { ship_address_attributes: valid_address_attributes } }
198
198
  expect(user.reload.ship_address.city).to eq('New York')
199
199
  end
200
200
 
201
201
  it "can update bill_address attributes" do
202
- post :update, { id: user.id, user: { bill_address_attributes: valid_address_attributes } }
202
+ post :update, params: { id: user.id, user: { bill_address_attributes: valid_address_attributes } }
203
203
  expect(user.reload.bill_address.city).to eq('New York')
204
204
  end
205
205
 
206
206
  it "can set stock locations" do
207
207
  location = Spree::StockLocation.create(name: "my_location")
208
208
  location_2 = Spree::StockLocation.create(name: "my_location_2")
209
- post :update, { id: user.id, user: { stock_location_ids: [location.id, location_2.id] } }
209
+ post :update, params: { id: user.id, user: { stock_location_ids: [location.id, location_2.id] } }
210
210
  expect(user.stock_locations).to match_array([location, location_2])
211
211
  end
212
212
  end
@@ -220,13 +220,13 @@ describe Spree::Admin::UsersController, type: :controller do
220
220
  before { user.orders << order }
221
221
 
222
222
  it "assigns a list of the users orders" do
223
- get :orders, { id: user.id }
223
+ get :orders, params: { id: user.id }
224
224
  expect(assigns[:orders].count).to eq 1
225
225
  expect(assigns[:orders].first).to eq order
226
226
  end
227
227
 
228
228
  it "assigns a ransack search for Spree::Order" do
229
- get :orders, { id: user.id }
229
+ get :orders, params: { id: user.id }
230
230
  expect(assigns[:search]).to be_a Ransack::Search
231
231
  expect(assigns[:search].klass).to eq Spree::Order
232
232
  end
@@ -241,13 +241,13 @@ describe Spree::Admin::UsersController, type: :controller do
241
241
  before { user.orders << order }
242
242
 
243
243
  it "assigns a list of the users orders" do
244
- get :items, { id: user.id }
244
+ get :items, params: { id: user.id }
245
245
  expect(assigns[:orders].count).to eq 1
246
246
  expect(assigns[:orders].first).to eq order
247
247
  end
248
248
 
249
249
  it "assigns a ransack search for Spree::Order" do
250
- get :items, { id: user.id }
250
+ get :items, params: { id: user.id }
251
251
  expect(assigns[:search]).to be_a Ransack::Search
252
252
  expect(assigns[:search].klass).to eq Spree::Order
253
253
  end
@@ -14,7 +14,7 @@ module Spree
14
14
 
15
15
  context "deleted is not requested" do
16
16
  it "does not assign deleted variants for a requested product" do
17
- get :index, product_id: product.slug
17
+ get :index, params: { product_id: product.slug }
18
18
  expect(assigns(:collection)).to include variant_1
19
19
  expect(assigns(:collection)).not_to include variant_2
20
20
  end
@@ -22,7 +22,7 @@ module Spree
22
22
 
23
23
  context "deleted is requested" do
24
24
  it "assigns deleted along with non-deleted variants for a requested product" do
25
- get :index, product_id: product.slug, deleted: "on"
25
+ get :index, params: { product_id: product.slug, deleted: "on" }
26
26
  expect(assigns(:collection)).to include variant_1
27
27
  expect(assigns(:collection)).to include variant_2
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 2.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.4.2
19
+ version: 2.0.0.beta1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.4.2
26
+ version: 2.0.0.beta1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: solidus_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.4.2
33
+ version: 2.0.0.beta1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.4.2
40
+ version: 2.0.0.beta1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sass-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -900,13 +900,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
900
900
  version: 2.1.0
901
901
  required_rubygems_version: !ruby/object:Gem::Requirement
902
902
  requirements:
903
- - - ">="
903
+ - - ">"
904
904
  - !ruby/object:Gem::Version
905
- version: '0'
905
+ version: 1.3.1
906
906
  requirements:
907
907
  - none
908
908
  rubyforge_project: solidus_backend
909
- rubygems_version: 2.6.11
909
+ rubygems_version: 2.5.1
910
910
  signing_key:
911
911
  specification_version: 4
912
912
  summary: Admin interface for the Solidus e-commerce framework.