solidus_frontend 1.3.1 → 1.3.2

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

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b97ed0b8e6d1c95ac45afeca62206eeb5d78607b
4
- data.tar.gz: 01cf88fced0ac510d8329164e49165fedcf0ebd3
3
+ metadata.gz: ec0a60cd964cb481ad0404e8c0a18c1469c997dc
4
+ data.tar.gz: 366cef2fc5b46bf08d246a2c0aad1fbfdbab0c42
5
5
  SHA512:
6
- metadata.gz: 0c89604e7dd022e63c5eec79c6ad9f74ce8933e618618b305f767bb66cee4615d9c8c01bbbd0f32a023830b01ea38a72a743ed8b46ab89211fa6792fbc7407d8
7
- data.tar.gz: 6d934414a0e74f6a7432e1efe228257343783860af4e81f222072b14b392c34e46ef848f464f9ea2876533f411e5a4022973407c937f86034e4d6a99d759661f
6
+ metadata.gz: f5a0bcc818038753a5715a8d196ba1b4a4555d8314c111b454bc13fa82a30dbd7ccd9ee9b2dc76b6c905ed94f4b11f454745734f2d64e1882f251834b88f0ce7
7
+ data.tar.gz: e4c70d0029b2f0b740d35b9635c539ba6ace1164d4326edd989c34ae2de5fa03041eab83d61eb287031b42bf0639b27d354b9b9db14b1be5fe40b67f9fc301e0
@@ -81,10 +81,9 @@ describe Spree::CheckoutController, type: :controller do
81
81
  }
82
82
  end
83
83
 
84
+ let!(:payment_method) { create(:payment_method) }
84
85
  before do
85
86
  # Must have *a* shipping method and a payment method so updating from address works
86
- allow(order).to receive_messages available_shipping_methods: [stub_model(Spree::ShippingMethod)]
87
- allow(order).to receive_messages available_payment_methods: [stub_model(Spree::PaymentMethod)]
88
87
  allow(order).to receive_messages ensure_available_shipping_rates: true
89
88
  order.line_items << FactoryGirl.create(:line_item)
90
89
  end
@@ -217,6 +216,53 @@ describe Spree::CheckoutController, type: :controller do
217
216
  end
218
217
  end
219
218
 
219
+ context "when in the payment state" do
220
+ let(:order) { create(:order_with_line_items) }
221
+ let(:payment_method) { create(:credit_card_payment_method) }
222
+
223
+ let(:params) do
224
+ {
225
+ state: 'payment',
226
+ order: {
227
+ payments_attributes: [
228
+ {
229
+ payment_method_id: payment_method.id.to_s,
230
+ source_attributes: attributes_for(:credit_card)
231
+ }
232
+ ]
233
+ }
234
+ }
235
+ end
236
+
237
+ before do
238
+ order.update_attributes! user: user
239
+ 3.times { order.next! } # should put us in the payment state
240
+ end
241
+
242
+ context 'with a permitted payment method' do
243
+ it 'sets the payment amount' do
244
+ post :update, params
245
+ order.reload
246
+ expect(order.state).to eq('confirm')
247
+ expect(order.payments.size).to eq(1)
248
+ expect(order.payments.first.amount).to eq(order.total)
249
+ end
250
+ end
251
+
252
+ context 'with an unpermitted payment method' do
253
+ before { payment_method.update!(display_on: "back_end") }
254
+
255
+ it 'sets the payment amount' do
256
+ expect {
257
+ post :update, params
258
+ }.to raise_error(ActiveRecord::RecordNotFound)
259
+
260
+ expect(order.state).to eq('payment')
261
+ expect(order.payments).to be_empty
262
+ end
263
+ end
264
+ end
265
+
220
266
  context "when in the confirm state" do
221
267
  before do
222
268
  order.update_attributes! user: user
@@ -77,9 +77,9 @@ describe "Checkout", type: :feature, inaccessible: true do
77
77
 
78
78
  # Regression test for https://github.com/spree/spree/issues/2694 and https://github.com/spree/spree/issues/4117
79
79
  context "doesn't allow bad credit card numbers" do
80
+ let!(:payment_method) { create(:credit_card_payment_method) }
80
81
  before(:each) do
81
82
  order = OrderWalkthrough.up_to(:delivery)
82
- allow(order).to receive_messages(available_payment_methods: [create(:credit_card_payment_method)])
83
83
 
84
84
  user = create(:user)
85
85
  order.user = user
@@ -180,7 +180,8 @@ describe "Checkout", type: :feature, inaccessible: true do
180
180
  end
181
181
 
182
182
  context "user has payment sources", js: true do
183
- let(:bogus) { create(:credit_card_payment_method) }
183
+ before { Spree::PaymentMethod.all.each(&:really_destroy!) }
184
+ let!(:bogus) { create(:credit_card_payment_method) }
184
185
  let(:user) { create(:user) }
185
186
 
186
187
  let!(:credit_card) do
@@ -189,7 +190,6 @@ describe "Checkout", type: :feature, inaccessible: true do
189
190
 
190
191
  before do
191
192
  order = OrderWalkthrough.up_to(:delivery)
192
- allow(order).to receive_messages(available_payment_methods: [bogus])
193
193
 
194
194
  allow_any_instance_of(Spree::CheckoutController).to receive_messages(current_order: order)
195
195
  allow_any_instance_of(Spree::CheckoutController).to receive_messages(try_spree_current_user: user)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-06 00:00:00.000000000 Z
11
+ date: 2017-12-12 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.3.1
19
+ version: 1.3.2
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.3.1
26
+ version: 1.3.2
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.3.1
33
+ version: 1.3.2
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.3.1
40
+ version: 1.3.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -345,7 +345,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
345
  requirements:
346
346
  - none
347
347
  rubyforge_project: solidus_frontend
348
- rubygems_version: 2.5.1
348
+ rubygems_version: 2.6.11
349
349
  signing_key:
350
350
  specification_version: 4
351
351
  summary: Cart and storefront for the Solidus e-commerce project.