solidus_frontend 1.1.3 → 1.1.4

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: 34b397ccff6674c985a10c902763205736142b68
4
- data.tar.gz: 92c84ff71a8d92b971d5a6eb6acac0fa5f215b85
3
+ metadata.gz: 63bfa9f673c5ba3f399dd3c643b1f231651b5533
4
+ data.tar.gz: 1d781adb44a73c8e505285962a4a4cd8065ecd73
5
5
  SHA512:
6
- metadata.gz: 2dbac571f495276e846a49122816b81890f4de1a5040a8d8695e3458e4df0c8f00aa4b7b60e72dd59bee4a8ac53cd953f8a94f6045d7cce619c8994439376ad3
7
- data.tar.gz: 664e2909ea113f18a748eec216ac86b7a1fffacdeb9557f60c1f026a751ac994b9c8ae9b287ed5a820c45e234c8b43a49ab8d0dbc22d8e7b57af622a0e27ab43
6
+ metadata.gz: c5772895992c212862e2c0880a9be288c2340f778a0bd8228b3c3401e7a0d9e514d945e76d1b56fa7ad1a5999a858e3e6c76dfcd31b4144ef9e5d5c639f93d02
7
+ data.tar.gz: 56b83d75ec28b5aff1f644b08b05fabf31682339617dd04263713c2d405b8c86b4a97f2f6c60fead48f1fd743c501daa9fa59015864a71b8ca2c25b2abe4df95
@@ -2,6 +2,8 @@ require 'rails/all'
2
2
  require 'jquery-rails'
3
3
  require 'canonical-rails'
4
4
  require 'deface'
5
+ require 'coffee-rails'
6
+ require 'sass-rails'
5
7
 
6
8
  require 'spree/core'
7
9
 
@@ -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
 
@@ -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
  order.update_column(:state, "confirm")
@@ -78,9 +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(: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.1.3
4
+ version: 1.1.4
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-02-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.1.3
19
+ version: 1.1.4
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.1.3
26
+ version: 1.1.4
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.1.3
33
+ version: 1.1.4
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.1.3
40
+ version: 1.1.4
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
@@ -555,9 +583,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
555
583
  requirements:
556
584
  - none
557
585
  rubyforge_project: solidus_frontend
558
- rubygems_version: 2.5.1
586
+ rubygems_version: 2.6.11
559
587
  signing_key:
560
588
  specification_version: 4
561
589
  summary: Cart and storefront for the Solidus e-commerce project.
562
590
  test_files: []
563
- has_rdoc: