solidus_frontend 1.2.2 → 1.2.3

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: 1a073d1ba90940680de1e03dd1d403539a82e31d
4
- data.tar.gz: b8b09efa9abf34bf48eb290e47120724025e5277
3
+ metadata.gz: e875f120357aaa10f87a6402b432178994b778de
4
+ data.tar.gz: ff5d741b59b823fefcc6b9957b129674684bf128
5
5
  SHA512:
6
- metadata.gz: 3f98767df7f622086e93156289c09aaaac38334e81208f2dfdf71c1b15c073e04ad1cb5908416fbd104abd9c0f3cdb7478296328e8306134b74c6a8a31f08e08
7
- data.tar.gz: f333f12f4a88c95e539afe5ad537ee2a9de63a7b4e14517882be6a6fbc89c0e24a2ea027e6cda6accf8c74aa7ad8ae12f6635c876e146f8c9f6f5850f1053d52
6
+ metadata.gz: c5b686c9cd37c5ac17ba25f99e703378fa83331ad211bc70b6dfd01384fb4f27458e6a167412c007c34783b4c460f857f19c36d8e8b18f99fa7bac46c0ad71ff
7
+ data.tar.gz: 7ee3ed72eb625df00e3ae44128d0afab3479e6986794f6236a8be78d87304fc2b81b99ffbfa8db2e72522ae5c288ea222157fe8f197979922b2fd36a8c4bc580
@@ -1,6 +1,8 @@
1
1
  require 'rails/all'
2
2
  require 'jquery-rails'
3
3
  require 'canonical-rails'
4
+ require 'coffee-rails'
5
+ require 'sass-rails'
4
6
 
5
7
  require 'spree/core'
6
8
 
@@ -23,6 +23,8 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_dependency 'canonical-rails', '~> 0.0.4'
25
25
  s.add_dependency 'jquery-rails'
26
+ s.add_dependency 'sass-rails'
27
+ s.add_dependency 'coffee-rails'
26
28
 
27
29
  s.add_development_dependency 'capybara-accessible'
28
30
  end
@@ -81,11 +81,10 @@ 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
- 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
 
@@ -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
@@ -78,9 +78,9 @@ describe "Checkout", type: :feature, inaccessible: true do
78
78
 
79
79
  # Regression test for https://github.com/spree/spree/issues/2694 and https://github.com/spree/spree/issues/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(:available_payment_methods => [ create(:credit_card_payment_method) ])
84
84
 
85
85
  user = create(:user)
86
86
  order.user = user
@@ -181,7 +181,8 @@ describe "Checkout", type: :feature, inaccessible: true do
181
181
  end
182
182
 
183
183
  context "user has payment sources", js: true do
184
- let(:bogus) { create(:credit_card_payment_method) }
184
+ before { Spree::PaymentMethod.all.each(&:really_destroy!) }
185
+ let!(:bogus) { create(:credit_card_payment_method) }
185
186
  let(:user) { create(:user) }
186
187
 
187
188
  let!(:credit_card) do
@@ -190,7 +191,6 @@ describe "Checkout", type: :feature, inaccessible: true do
190
191
 
191
192
  before do
192
193
  order = OrderWalkthrough.up_to(:delivery)
193
- allow(order).to receive_messages(:available_payment_methods => [bogus])
194
194
 
195
195
  allow_any_instance_of(Spree::CheckoutController).to receive_messages(current_order: order)
196
196
  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.2.2
4
+ version: 1.2.3
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-07 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.2.2
19
+ version: 1.2.3
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.2.2
26
+ version: 1.2.3
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.2.2
33
+ version: 1.2.3
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.2.2
40
+ version: 1.2.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sass-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coffee-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: capybara-accessible
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -302,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
330
  requirements:
303
331
  - none
304
332
  rubyforge_project: solidus_frontend
305
- rubygems_version: 2.5.1
333
+ rubygems_version: 2.6.11
306
334
  signing_key:
307
335
  specification_version: 4
308
336
  summary: Cart and storefront for the Solidus e-commerce project.