solidus_frontend 1.0.6 → 1.0.7

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: b5dc8e6150945aea0c6c0d848c0cd10028ef8cbd
4
- data.tar.gz: 90ceb2f21ca40a2a96e5aff6ad405d8db3455cca
3
+ metadata.gz: d69d090e995c26e97c4b9eed6a36205ba4c8721e
4
+ data.tar.gz: 51856049c68819c9f9a2dfc1fdcccb569e037c02
5
5
  SHA512:
6
- metadata.gz: be628e3c44335cc8b4cd6c5c06f37ca03188d5d2d9bf89a73f3025aeed05b3e1160dd7ba0935c50b3b758dce8c745c428b0e17c509c1136fe768b61b6c68c42f
7
- data.tar.gz: 4394fffa2e998a84b07de3023ae75584b06fd0f11a04d84c3b53c10b4899ac22d92d999683b374949d279dabab3a4b1252ccc2d4033fb12fdf18c62ca924c53e
6
+ metadata.gz: 525ef3dfd169cd8b2df4ac37387658dce47392811e89afe4e1ae0fe677bc1d5a313de1d5ddb9bffcb2015bb885d2948ac46b113055632c91eb25fb2bc5501d94
7
+ data.tar.gz: 13dea3731b3f1d2a754aa0b70964f8ff1293753fc23bce330e779b221d3605e243a96bb35e0af8d05d345fb4cd96bd9d8799db7897159440e50a5690c5d3bce6
@@ -81,11 +81,10 @@ describe Spree::CheckoutController, :type => :controller do
81
81
  }
82
82
  end
83
83
 
84
+ let!(:payment_method) { create(:credit_card_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
- allow(order).to receive_messages :ensure_available_shipping_rates => true
87
+ allow(order).to receive_messages ensure_available_shipping_rates: true
89
88
  order.line_items << FactoryGirl.create(:line_item)
90
89
  end
91
90
 
@@ -170,6 +169,53 @@ describe Spree::CheckoutController, :type => :controller do
170
169
  end
171
170
  end
172
171
 
172
+ context "when in the payment state" do
173
+ let(:order) { create(:order_with_line_items) }
174
+ let(:payment_method) { create(:credit_card_payment_method) }
175
+
176
+ let(:params) do
177
+ {
178
+ state: 'payment',
179
+ order: {
180
+ payments_attributes: [
181
+ {
182
+ payment_method_id: payment_method.id.to_s,
183
+ source_attributes: attributes_for(:credit_card)
184
+ }
185
+ ]
186
+ }
187
+ }
188
+ end
189
+
190
+ before do
191
+ order.update_attributes! user: user
192
+ 3.times { order.next! } # should put us in the payment state
193
+ end
194
+
195
+ context 'with a permitted payment method' do
196
+ it 'sets the payment amount' do
197
+ post :update, params
198
+ order.reload
199
+ expect(order.state).to eq('confirm')
200
+ expect(order.payments.size).to eq(1)
201
+ expect(order.payments.first.amount).to eq(order.total)
202
+ end
203
+ end
204
+
205
+ context 'with an unpermitted payment method' do
206
+ before { payment_method.update!(display_on: "back_end") }
207
+
208
+ it 'sets the payment amount' do
209
+ expect {
210
+ post :update, params
211
+ }.to raise_error(ActiveRecord::RecordNotFound)
212
+
213
+ expect(order.state).to eq('payment')
214
+ expect(order.payments).to be_empty
215
+ end
216
+ end
217
+ end
218
+
173
219
  context "when in the confirm state" do
174
220
  before do
175
221
  allow(order).to receive_messages :confirmation_required? => true
@@ -78,10 +78,9 @@ describe "Checkout", type: :feature, inaccessible: true do
78
78
 
79
79
  # Regression test for #2694 and #4117
80
80
  context "doesn't allow bad credit card numbers" do
81
+ let!(:payment_method) { create(:credit_card_payment_method) }
81
82
  before(:each) do
82
83
  order = OrderWalkthrough.up_to(:delivery)
83
- allow(order).to receive_messages :confirmation_required? => true
84
- allow(order).to receive_messages(:available_payment_methods => [ create(:credit_card_payment_method, :environment => 'test') ])
85
84
 
86
85
  user = create(:user)
87
86
  order.user = user
@@ -183,7 +182,8 @@ describe "Checkout", type: :feature, inaccessible: true do
183
182
  end
184
183
 
185
184
  context "user has payment sources", js: true do
186
- let(:bogus) { create(:credit_card_payment_method) }
185
+ before { Spree::PaymentMethod.all.each(&:really_destroy!) }
186
+ let!(:bogus) { create(:credit_card_payment_method) }
187
187
  let(:user) { create(:user) }
188
188
 
189
189
  let!(:credit_card) do
@@ -192,7 +192,6 @@ describe "Checkout", type: :feature, inaccessible: true do
192
192
 
193
193
  before do
194
194
  order = OrderWalkthrough.up_to(:delivery)
195
- allow(order).to receive_messages(:available_payment_methods => [bogus])
196
195
 
197
196
  allow_any_instance_of(Spree::CheckoutController).to receive_messages(current_order: order)
198
197
  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.0.6
4
+ version: 1.0.7
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-03-23 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.0.6
19
+ version: 1.0.7
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.0.6
26
+ version: 1.0.7
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.0.6
33
+ version: 1.0.7
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.0.6
40
+ version: 1.0.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -585,7 +585,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
585
585
  requirements:
586
586
  - none
587
587
  rubyforge_project: solidus_frontend
588
- rubygems_version: 2.5.1
588
+ rubygems_version: 2.6.11
589
589
  signing_key:
590
590
  specification_version: 4
591
591
  summary: Cart and storefront for the Solidus e-commerce project.