solidus_frontend 2.9.5 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of solidus_frontend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/spree/frontend/screen.css.scss +3 -3
- data/app/controllers/spree/checkout_controller.rb +21 -5
- data/app/controllers/spree/orders_controller.rb +6 -2
- data/lib/generators/solidus/views/override_generator.rb +3 -2
- data/lib/spree/frontend/config.rb +9 -0
- data/lib/spree/frontend/engine.rb +5 -3
- data/lib/spree/frontend/middleware/seo_assist.rb +4 -4
- data/{app/models → lib}/spree/frontend_configuration.rb +1 -1
- data/solidus_frontend.gemspec +2 -1
- data/spec/controllers/spree/checkout_controller_spec.rb +48 -19
- data/spec/controllers/spree/orders_controller_ability_spec.rb +1 -1
- data/spec/controllers/spree/orders_controller_spec.rb +27 -2
- data/spec/features/checkout_spec.rb +59 -0
- data/spec/features/products_spec.rb +4 -4
- data/spec/features/taxons_spec.rb +4 -4
- metadata +23 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1d1115296b3520f07356e280c02ceab2609125ee67758dcb29c9c6f18efcd4f
|
4
|
+
data.tar.gz: 4f63523b78b45c1068627238f9b1db48c6ab153159486cc179788dc9dc711137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5da6d12d9fddc6bae0699a7d9a042b8481d6a4f08fde2e6313e9e726b41cc74c067473cda1253fefd5b8ce9d6268ad6be508dbf020a60df54a3d8c926a2a4ba
|
7
|
+
data.tar.gz: 8764e0fae47581fdfc0c34b7f64a6bd4f841cbaeee229d0f5a3b27b2961f0a5197a0d93e3d9c6ddae3bf3421d8170c4ee3a442f02a01f42281a4312854851ffe
|
@@ -963,8 +963,8 @@ p[data-hook="use_billing"] {
|
|
963
963
|
}
|
964
964
|
|
965
965
|
input[type="text"] {
|
966
|
-
flex:
|
967
|
-
width:
|
966
|
+
flex: 1 auto;
|
967
|
+
width: 50%;
|
968
968
|
margin-right: 5px;
|
969
969
|
}
|
970
970
|
|
@@ -1268,7 +1268,7 @@ table.order-summary {
|
|
1268
1268
|
// # Logo
|
1269
1269
|
#logo {
|
1270
1270
|
padding: 20px 0;
|
1271
|
-
|
1271
|
+
|
1272
1272
|
> a {
|
1273
1273
|
display: inline-block;
|
1274
1274
|
}
|
@@ -17,7 +17,7 @@ module Spree
|
|
17
17
|
|
18
18
|
before_action :associate_user
|
19
19
|
before_action :check_authorization
|
20
|
-
before_action :apply_coupon_code
|
20
|
+
before_action :apply_coupon_code, only: [:update]
|
21
21
|
|
22
22
|
before_action :setup_for_current_state, only: [:edit, :update]
|
23
23
|
|
@@ -87,11 +87,23 @@ module Spree
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def update_params
|
90
|
-
|
91
|
-
|
90
|
+
case params[:state].to_sym
|
91
|
+
when :address
|
92
|
+
massaged_params.require(:order).permit(
|
93
|
+
permitted_checkout_address_attributes
|
94
|
+
)
|
95
|
+
when :delivery
|
96
|
+
massaged_params.require(:order).permit(
|
97
|
+
permitted_checkout_delivery_attributes
|
98
|
+
)
|
99
|
+
when :payment
|
100
|
+
massaged_params.require(:order).permit(
|
101
|
+
permitted_checkout_payment_attributes
|
102
|
+
)
|
92
103
|
else
|
93
|
-
|
94
|
-
|
104
|
+
massaged_params.fetch(:order, {}).permit(
|
105
|
+
permitted_checkout_confirm_attributes
|
106
|
+
)
|
95
107
|
end
|
96
108
|
end
|
97
109
|
|
@@ -137,6 +149,10 @@ module Spree
|
|
137
149
|
redirect_to(spree.cart_path) && return unless @order
|
138
150
|
end
|
139
151
|
|
152
|
+
# Allow the customer to only go back or stay on the current state
|
153
|
+
# when trying to change it via params[:state]. It's not allowed to
|
154
|
+
# jump forward and skip states (unless #skip_state_validation? is
|
155
|
+
# truthy).
|
140
156
|
def set_state_if_present
|
141
157
|
if params[:state]
|
142
158
|
redirect_to checkout_state_path(@order.state) if @order.can_go_to_state?(params[:state]) && !skip_state_validation?
|
@@ -42,6 +42,10 @@ module Spree
|
|
42
42
|
@order = current_order || Spree::Order.incomplete.find_or_initialize_by(guest_token: cookies.signed[:guest_token])
|
43
43
|
authorize! :read, @order, cookies.signed[:guest_token]
|
44
44
|
associate_user
|
45
|
+
if params[:id] && @order.number != params[:id]
|
46
|
+
flash[:error] = t('spree.cannot_edit_orders')
|
47
|
+
redirect_to cart_path
|
48
|
+
end
|
45
49
|
end
|
46
50
|
|
47
51
|
# Adds a new item to the order (creating a new order if none already exists)
|
@@ -59,8 +63,8 @@ module Spree
|
|
59
63
|
|
60
64
|
begin
|
61
65
|
@line_item = @order.contents.add(variant, quantity)
|
62
|
-
rescue ActiveRecord::RecordInvalid =>
|
63
|
-
@order.errors.add(:base,
|
66
|
+
rescue ActiveRecord::RecordInvalid => error
|
67
|
+
@order.errors.add(:base, error.record.errors.full_messages.join(", "))
|
64
68
|
end
|
65
69
|
|
66
70
|
respond_with(@order) do |format|
|
@@ -24,6 +24,7 @@ module Solidus
|
|
24
24
|
def copy_views
|
25
25
|
views_to_copy.each do |file|
|
26
26
|
next if File.directory?(file)
|
27
|
+
|
27
28
|
dest_file = Pathname.new(file).relative_path_from(source_dir)
|
28
29
|
copy_file file, Rails.root.join('app', 'views', 'spree', dest_file)
|
29
30
|
end
|
@@ -33,8 +34,8 @@ module Solidus
|
|
33
34
|
|
34
35
|
def views_to_copy
|
35
36
|
if @options['only']
|
36
|
-
VIEWS.select do |
|
37
|
-
Pathname.new(
|
37
|
+
VIEWS.select do |view|
|
38
|
+
Pathname.new(view).relative_path_from(source_dir).to_s.include?(@options['only'])
|
38
39
|
end
|
39
40
|
else
|
40
41
|
VIEWS
|
@@ -1,13 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'spree/frontend/config'
|
4
|
+
|
3
5
|
module Spree
|
4
6
|
module Frontend
|
5
7
|
class Engine < ::Rails::Engine
|
6
8
|
config.middleware.use "Spree::Frontend::Middleware::SeoAssist"
|
7
9
|
|
8
|
-
initializer
|
9
|
-
|
10
|
-
end
|
10
|
+
# Leave initializer empty for backwards-compatability. Other apps
|
11
|
+
# might still rely on this event.
|
12
|
+
initializer "spree.frontend.environment", before: :load_config_initializers do; end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -38,11 +38,11 @@ module Spree
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def build_query(params)
|
41
|
-
params.map { |
|
42
|
-
if
|
43
|
-
build_query(
|
41
|
+
params.map { |key, value|
|
42
|
+
if value.class == Array
|
43
|
+
build_query(value.map { |parameter| ["#{key}[]", parameter] })
|
44
44
|
else
|
45
|
-
|
45
|
+
key + "=" + Rack::Utils.escape(value)
|
46
46
|
end
|
47
47
|
}.join("&")
|
48
48
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Spree
|
4
4
|
class FrontendConfiguration < Preferences::Configuration
|
5
|
-
preference :locale, :string, default:
|
5
|
+
preference :locale, :string, default: I18n.default_locale
|
6
6
|
|
7
7
|
# Add your terms and conditions in app/views/spree/checkout/_terms_and_conditions.en.html.erb
|
8
8
|
preference :require_terms_and_conditions_acceptance, :boolean, default: false
|
data/solidus_frontend.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.require_path = 'lib'
|
19
19
|
s.requirements << 'none'
|
20
20
|
|
21
|
-
s.required_ruby_version = '>= 2.
|
21
|
+
s.required_ruby_version = '>= 2.4.0'
|
22
22
|
s.required_rubygems_version = '>= 1.8.23'
|
23
23
|
|
24
24
|
s.add_dependency 'solidus_api', s.version
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_dependency 'font-awesome-rails', '~> 4.0'
|
29
29
|
s.add_dependency 'jquery-rails'
|
30
30
|
s.add_dependency 'kaminari', '~> 1.1'
|
31
|
+
s.add_dependency 'responders'
|
31
32
|
s.add_dependency 'sassc-rails'
|
32
33
|
s.add_dependency 'truncate_html', '~> 0.9', '>= 0.9.2'
|
33
34
|
|
@@ -68,7 +68,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
68
68
|
it 'should check if the user is authorized for :edit' do
|
69
69
|
expect(controller).to receive(:authorize!).with(:edit, order, token)
|
70
70
|
request.cookie_jar.signed[:guest_token] = token
|
71
|
-
post :update, params: { state: 'address' }
|
71
|
+
post :update, params: { state: 'address', order: { bill_address_attributes: address_params } }
|
72
72
|
end
|
73
73
|
|
74
74
|
context "save successful" do
|
@@ -91,12 +91,12 @@ describe Spree::CheckoutController, type: :controller do
|
|
91
91
|
|
92
92
|
context "with the order in the cart state", partial_double_verification: false do
|
93
93
|
before do
|
94
|
-
order.
|
94
|
+
order.update! user: user
|
95
95
|
order.update_column(:state, "cart")
|
96
96
|
end
|
97
97
|
|
98
98
|
it "should assign order" do
|
99
|
-
post :update, params: { state: "address" }
|
99
|
+
post :update, params: { state: "address", order: { bill_address_attributes: address_params } }
|
100
100
|
expect(assigns[:order]).not_to be_nil
|
101
101
|
end
|
102
102
|
|
@@ -140,7 +140,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
140
140
|
|
141
141
|
context "with the order in the address state", partial_double_verification: false do
|
142
142
|
before do
|
143
|
-
order.
|
143
|
+
order.update! user: user
|
144
144
|
order.update_columns(ship_address_id: create(:address).id, state: "address")
|
145
145
|
end
|
146
146
|
|
@@ -213,7 +213,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
213
213
|
end
|
214
214
|
|
215
215
|
before do
|
216
|
-
order.
|
216
|
+
order.update! user: user
|
217
217
|
3.times { order.next! } # should put us in the payment state
|
218
218
|
end
|
219
219
|
|
@@ -245,7 +245,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
245
245
|
end
|
246
246
|
|
247
247
|
before do
|
248
|
-
order.
|
248
|
+
order.update! user: user
|
249
249
|
3.times { order.next! } # should put us in the payment state
|
250
250
|
end
|
251
251
|
|
@@ -271,11 +271,36 @@ describe Spree::CheckoutController, type: :controller do
|
|
271
271
|
expect(order.payments).to be_empty
|
272
272
|
end
|
273
273
|
end
|
274
|
+
|
275
|
+
context 'trying to change the address' do
|
276
|
+
let(:params) do
|
277
|
+
{
|
278
|
+
state: 'payment',
|
279
|
+
order: {
|
280
|
+
payments_attributes: [
|
281
|
+
{
|
282
|
+
payment_method_id: payment_method.id.to_s,
|
283
|
+
source_attributes: attributes_for(:credit_card)
|
284
|
+
}
|
285
|
+
],
|
286
|
+
ship_address_attributes: {
|
287
|
+
zipcode: 'TEST'
|
288
|
+
}
|
289
|
+
}
|
290
|
+
}
|
291
|
+
end
|
292
|
+
|
293
|
+
it 'does not change the address' do
|
294
|
+
expect do
|
295
|
+
post :update, params: params
|
296
|
+
end.not_to change { order.reload.ship_address.zipcode }
|
297
|
+
end
|
298
|
+
end
|
274
299
|
end
|
275
300
|
|
276
301
|
context "when in the confirm state" do
|
277
302
|
before do
|
278
|
-
order.
|
303
|
+
order.update! user: user
|
279
304
|
order.update_column(:state, "confirm")
|
280
305
|
# An order requires a payment to reach the complete state
|
281
306
|
# This is because payment_required? is true on the order
|
@@ -305,21 +330,23 @@ describe Spree::CheckoutController, type: :controller do
|
|
305
330
|
|
306
331
|
context "save unsuccessful" do
|
307
332
|
before do
|
308
|
-
order.
|
333
|
+
order.update! user: user
|
309
334
|
allow(order).to receive_messages valid?: false
|
310
335
|
end
|
311
336
|
|
312
337
|
it "should not assign order" do
|
313
|
-
post :update, params: { state: "address", email: ''
|
338
|
+
post :update, params: { state: "address", order: { email: ''} }
|
314
339
|
expect(assigns[:order]).not_to be_nil
|
315
340
|
end
|
316
341
|
|
317
342
|
it "should not change the order state" do
|
318
|
-
|
343
|
+
expect do
|
344
|
+
post :update, params: { state: 'address', order: { bill_address_attributes: address_params } }
|
345
|
+
end.not_to change { order.reload.state }
|
319
346
|
end
|
320
347
|
|
321
348
|
it "should render the edit template" do
|
322
|
-
post :update, params: { state: 'address' }
|
349
|
+
post :update, params: { state: 'address', order: { bill_address_attributes: address_params } }
|
323
350
|
expect(response).to render_template :edit
|
324
351
|
end
|
325
352
|
end
|
@@ -340,9 +367,9 @@ describe Spree::CheckoutController, type: :controller do
|
|
340
367
|
|
341
368
|
context "Spree::Core::GatewayError" do
|
342
369
|
before do
|
343
|
-
order.
|
370
|
+
order.update! user: user
|
344
371
|
allow(order).to receive(:next).and_raise(Spree::Core::GatewayError.new("Invalid something or other."))
|
345
|
-
post :update, params: { state: "address" }
|
372
|
+
post :update, params: { state: "address", order: { bill_address_attributes: address_params } }
|
346
373
|
end
|
347
374
|
|
348
375
|
it "should render the edit template and display exception message" do
|
@@ -373,7 +400,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
373
400
|
end
|
374
401
|
|
375
402
|
it "due to the order having errors" do
|
376
|
-
put :update, params: { state: order.state, order: {} }
|
403
|
+
put :update, params: { state: order.state, order: { bill_address_attributes: address_params } }
|
377
404
|
expect(flash[:error]).to eq("Base error\nAdjustments error")
|
378
405
|
expect(response).to redirect_to(spree.checkout_state_path('address'))
|
379
406
|
end
|
@@ -387,7 +414,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
387
414
|
end
|
388
415
|
|
389
416
|
it "due to no available shipping rates for any of the shipments" do
|
390
|
-
put :update, params: { state: "address", order: {} }
|
417
|
+
put :update, params: { state: "address", order: { bill_address_attributes: address_params } }
|
391
418
|
expect(flash[:error]).to eq(I18n.t('spree.items_cannot_be_shipped'))
|
392
419
|
expect(response).to redirect_to(spree.checkout_state_path('address'))
|
393
420
|
end
|
@@ -437,7 +464,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
437
464
|
end
|
438
465
|
|
439
466
|
it "redirects the customer to the cart page with an error message" do
|
440
|
-
put :update, params: { state: order.state, order: {} }
|
467
|
+
put :update, params: { state: order.state, order: { bill_address_attributes: address_params } }
|
441
468
|
expect(flash[:error]).to eq(I18n.t('spree.insufficient_stock_for_order'))
|
442
469
|
expect(response).to redirect_to(spree.cart_path)
|
443
470
|
end
|
@@ -494,9 +521,11 @@ describe Spree::CheckoutController, type: :controller do
|
|
494
521
|
allow(controller).to receive_messages check_authorization: true
|
495
522
|
end
|
496
523
|
|
497
|
-
|
524
|
+
# This does not test whether the shipping address is set via params.
|
525
|
+
# It only tests whether it is set in the before action.
|
526
|
+
it "doesn't set a default shipping address on the order" do
|
498
527
|
expect(order).to_not receive(:ship_address=)
|
499
|
-
post :update, params: { state: order.state }
|
528
|
+
post :update, params: { state: order.state, order: { bill_address_attributes: address_params } }
|
500
529
|
end
|
501
530
|
|
502
531
|
it "doesn't remove unshippable items before payment" do
|
@@ -511,7 +540,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
511
540
|
allow(controller).to receive_messages check_authorization: true
|
512
541
|
|
513
542
|
expect {
|
514
|
-
post :update, params: { state: "payment" }
|
543
|
+
post :update, params: { state: "payment", order: { email: "johndoe@example.com"} }
|
515
544
|
}.to change { order.line_items.to_a.size }.from(1).to(0)
|
516
545
|
end
|
517
546
|
|
@@ -37,7 +37,7 @@ module Spree
|
|
37
37
|
|
38
38
|
context '#update' do
|
39
39
|
it 'should check if user is authorized for :update' do
|
40
|
-
allow(order).to receive :
|
40
|
+
allow(order).to receive :update
|
41
41
|
expect(controller).to receive(:authorize!).with(:update, order, token)
|
42
42
|
post :update, params: { order: { email: "foo@bar.com" }, token: token }
|
43
43
|
end
|
@@ -102,6 +102,31 @@ describe Spree::OrdersController, type: :controller do
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
context '#edit' do
|
106
|
+
before do
|
107
|
+
allow(controller).to receive :authorize!
|
108
|
+
allow(controller).to receive_messages current_order: order
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'should render cart' do
|
112
|
+
get :edit, params: { id: order.number }
|
113
|
+
|
114
|
+
expect(flash[:error]).to be_nil
|
115
|
+
expect(response).to be_ok
|
116
|
+
end
|
117
|
+
|
118
|
+
context 'with another order number than the current_order' do
|
119
|
+
let(:other_order) { create(:completed_order_with_totals) }
|
120
|
+
|
121
|
+
it 'should display error message' do
|
122
|
+
get :edit, params: { id: other_order.number }
|
123
|
+
|
124
|
+
expect(flash[:error]).to eq "You may only edit your current shopping cart."
|
125
|
+
expect(response).to redirect_to cart_path
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
105
130
|
context "#update" do
|
106
131
|
context "with authorization" do
|
107
132
|
before do
|
@@ -117,13 +142,13 @@ describe Spree::OrdersController, type: :controller do
|
|
117
142
|
end
|
118
143
|
|
119
144
|
it "should redirect to cart path (on success)" do
|
120
|
-
allow(order).to receive(:
|
145
|
+
allow(order).to receive(:update).and_return true
|
121
146
|
put :update
|
122
147
|
expect(response).to redirect_to(spree.cart_path)
|
123
148
|
end
|
124
149
|
|
125
150
|
it "should advance the order if :checkout button is pressed" do
|
126
|
-
allow(order).to receive(:
|
151
|
+
allow(order).to receive(:update).and_return true
|
127
152
|
expect(order).to receive(:next)
|
128
153
|
put :update, params: { checkout: true }
|
129
154
|
expect(response).to redirect_to checkout_state_path('address')
|
@@ -374,6 +374,14 @@ describe "Checkout", type: :feature, inaccessible: true do
|
|
374
374
|
expect(page).to have_current_path(spree.order_path(Spree::Order.last))
|
375
375
|
expect(page).to have_content('Ending in 1111')
|
376
376
|
end
|
377
|
+
|
378
|
+
it "allows user to save a billing address associated to the credit card" do
|
379
|
+
choose "use_existing_card_no"
|
380
|
+
fill_in_credit_card
|
381
|
+
|
382
|
+
click_on "Save and Continue"
|
383
|
+
expect(Spree::CreditCard.last.address).to be_present
|
384
|
+
end
|
377
385
|
end
|
378
386
|
|
379
387
|
# regression for https://github.com/spree/spree/issues/2921
|
@@ -672,6 +680,57 @@ describe "Checkout", type: :feature, inaccessible: true do
|
|
672
680
|
end
|
673
681
|
end
|
674
682
|
|
683
|
+
# Regression test for: https://github.com/solidusio/solidus/issues/2998
|
684
|
+
context 'when two shipping categories are available' do
|
685
|
+
let!(:first_category) { create(:shipping_category) }
|
686
|
+
let!(:second_category) { create(:shipping_category) }
|
687
|
+
|
688
|
+
let!(:first_shipping_method) do
|
689
|
+
create(:shipping_method,
|
690
|
+
shipping_categories: [first_category],
|
691
|
+
stores: [store])
|
692
|
+
end
|
693
|
+
|
694
|
+
let!(:second_shipping_method) do
|
695
|
+
create(:shipping_method,
|
696
|
+
shipping_categories: [second_category],
|
697
|
+
stores: [store])
|
698
|
+
end
|
699
|
+
|
700
|
+
context 'assigned to two different products' do
|
701
|
+
let!(:first_product) do
|
702
|
+
create(:product,
|
703
|
+
name: 'First product',
|
704
|
+
shipping_category: first_category)
|
705
|
+
end
|
706
|
+
|
707
|
+
let!(:second_product) do
|
708
|
+
create(:product,
|
709
|
+
name: 'Second product',
|
710
|
+
shipping_category: second_category)
|
711
|
+
end
|
712
|
+
|
713
|
+
before do
|
714
|
+
stock_location.stock_items.update_all(count_on_hand: 10)
|
715
|
+
end
|
716
|
+
|
717
|
+
it 'transitions successfully to the delivery step', js: true do
|
718
|
+
visit spree.product_path(first_product)
|
719
|
+
click_button 'add-to-cart-button'
|
720
|
+
visit spree.product_path(second_product)
|
721
|
+
click_button 'add-to-cart-button'
|
722
|
+
|
723
|
+
click_button 'Checkout'
|
724
|
+
|
725
|
+
fill_in_address
|
726
|
+
fill_in 'order_email', with: 'test@example.com'
|
727
|
+
click_button 'Save and Continue'
|
728
|
+
|
729
|
+
expect(Spree::Order.last.state).to eq('delivery')
|
730
|
+
end
|
731
|
+
end
|
732
|
+
end
|
733
|
+
|
675
734
|
def fill_in_credit_card(number: "4111 1111 1111 1111")
|
676
735
|
fill_in "Name on card", with: 'Mary Doe'
|
677
736
|
fill_in_with_force "Card Number", with: number
|
@@ -51,20 +51,20 @@ describe "Visiting Products", type: :feature, inaccessible: true do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'displays metas' do
|
54
|
-
jersey.
|
54
|
+
jersey.update metas
|
55
55
|
click_link jersey.name
|
56
56
|
expect(page).to have_meta(:description, 'Brand new Ruby on Rails Jersey')
|
57
57
|
expect(page).to have_meta(:keywords, 'ror, jersey, ruby')
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'displays title if set' do
|
61
|
-
jersey.
|
61
|
+
jersey.update metas
|
62
62
|
click_link jersey.name
|
63
63
|
expect(page).to have_title('Ruby on Rails Baseball Jersey Buy High Quality Geek Apparel')
|
64
64
|
end
|
65
65
|
|
66
66
|
it "doesn't use meta_title as heading on page" do
|
67
|
-
jersey.
|
67
|
+
jersey.update metas
|
68
68
|
click_link jersey.name
|
69
69
|
within("h1") do
|
70
70
|
expect(page).to have_content(jersey.name)
|
@@ -73,7 +73,7 @@ describe "Visiting Products", type: :feature, inaccessible: true do
|
|
73
73
|
end
|
74
74
|
|
75
75
|
it 'uses product name in title when meta_title set to empty string' do
|
76
|
-
jersey.
|
76
|
+
jersey.update meta_title: ''
|
77
77
|
click_link jersey.name
|
78
78
|
expect(page).to have_title('Ruby on Rails Baseball Jersey - ' + store_name)
|
79
79
|
end
|
@@ -30,14 +30,14 @@ describe "viewing products", type: :feature, inaccessible: true do
|
|
30
30
|
|
31
31
|
describe 'meta tags and title' do
|
32
32
|
it 'displays metas' do
|
33
|
-
t_shirts.
|
33
|
+
t_shirts.update metas
|
34
34
|
visit '/t/category/super-clothing/t-shirts'
|
35
35
|
expect(page).to have_meta(:description, 'Brand new Ruby on Rails TShirts')
|
36
36
|
expect(page).to have_meta(:keywords, 'ror, tshirt, ruby')
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'display title if set' do
|
40
|
-
t_shirts.
|
40
|
+
t_shirts.update metas
|
41
41
|
visit '/t/category/super-clothing/t-shirts'
|
42
42
|
expect(page).to have_title("Ruby On Rails TShirt")
|
43
43
|
end
|
@@ -49,7 +49,7 @@ describe "viewing products", type: :feature, inaccessible: true do
|
|
49
49
|
|
50
50
|
# Regression test for https://github.com/spree/spree/issues/2814
|
51
51
|
it "doesn't use meta_title as heading on page" do
|
52
|
-
t_shirts.
|
52
|
+
t_shirts.update metas
|
53
53
|
visit '/t/category/super-clothing/t-shirts'
|
54
54
|
within("h1.taxon-title") do
|
55
55
|
expect(page).to have_content(t_shirts.name)
|
@@ -57,7 +57,7 @@ describe "viewing products", type: :feature, inaccessible: true do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'uses taxon name in title when meta_title set to empty string' do
|
60
|
-
t_shirts.
|
60
|
+
t_shirts.update meta_title: ''
|
61
61
|
visit '/t/category/super-clothing/t-shirts'
|
62
62
|
expect(page).to have_title('Category - T-Shirts - ' + store_name)
|
63
63
|
end
|
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: 2.
|
4
|
+
version: 2.10.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: 2020-
|
11
|
+
date: 2020-07-16 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: 2.
|
19
|
+
version: 2.10.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: 2.
|
26
|
+
version: 2.10.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: 2.
|
33
|
+
version: 2.10.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: 2.
|
40
|
+
version: 2.10.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: canonical-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: responders
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: sassc-rails
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,7 +218,6 @@ files:
|
|
204
218
|
- app/controllers/spree/taxons_controller.rb
|
205
219
|
- app/helpers/spree/orders_helper.rb
|
206
220
|
- app/helpers/spree/taxon_filters_helper.rb
|
207
|
-
- app/models/spree/frontend_configuration.rb
|
208
221
|
- app/views/spree/address/_form.html.erb
|
209
222
|
- app/views/spree/address/_form_hidden.html.erb
|
210
223
|
- app/views/spree/checkout/_address.html.erb
|
@@ -264,8 +277,10 @@ files:
|
|
264
277
|
- lib/generators/solidus/views/override_generator.rb
|
265
278
|
- lib/solidus_frontend.rb
|
266
279
|
- lib/spree/frontend.rb
|
280
|
+
- lib/spree/frontend/config.rb
|
267
281
|
- lib/spree/frontend/engine.rb
|
268
282
|
- lib/spree/frontend/middleware/seo_assist.rb
|
283
|
+
- lib/spree/frontend_configuration.rb
|
269
284
|
- lib/spree_frontend.rb
|
270
285
|
- lib/tasks/rake_util.rb
|
271
286
|
- lib/tasks/taxon.rake
|
@@ -324,7 +339,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
324
339
|
requirements:
|
325
340
|
- - ">="
|
326
341
|
- !ruby/object:Gem::Version
|
327
|
-
version: 2.
|
342
|
+
version: 2.4.0
|
328
343
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
329
344
|
requirements:
|
330
345
|
- - ">="
|