workarea-storefront 3.5.8 → 3.5.13
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.
- checksums.yaml +4 -4
- data/app/controllers/workarea/storefront/checkout/addresses_controller.rb +2 -0
- data/app/controllers/workarea/storefront/checkouts_controller.rb +1 -1
- data/app/controllers/workarea/storefront/current_checkout.rb +4 -1
- data/app/controllers/workarea/storefront/users/passwords_controller.rb +5 -1
- data/app/view_models/workarea/storefront/category_view_model.rb +1 -1
- data/app/views/workarea/storefront/fulfillment_mailer/shipped.html.haml +1 -1
- data/app/views/workarea/storefront/products/templates/_option_selects.html.haml +2 -0
- data/app/views/workarea/storefront/products/templates/_option_thumbnails.html.haml +2 -0
- data/config/locales/en.yml +2 -2
- data/test/integration/workarea/storefront/accounts_integration_test.rb +20 -0
- data/test/integration/workarea/storefront/categories_integration_test.rb +10 -0
- data/test/integration/workarea/storefront/checkouts_integration_test.rb +33 -0
- data/test/integration/workarea/storefront/current_checkout_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/search_integration_test.rb +10 -0
- data/test/integration/workarea/storefront/segments_integration_test.rb +13 -0
- data/test/integration/workarea/storefront/users/passwords_integration_test.rb +19 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ea6133352eedf9e8f948a185e5d1b989edc0c9664b21d2de8e5b496429a9938
|
4
|
+
data.tar.gz: 79c3922dc065c153aa2c0d3027d9a224b2a0a12795de5336e7a2083078719930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dfcb3326e1fd5f3d70644c6eb5d340495d370f72a380730c9c6775c47c1eed96782e284e7229efbda6b453be1149056e65138339d33bd04091946894f3db088
|
7
|
+
data.tar.gz: 3b2ee21944554f42fef34f75e519626ddf8363c599fd3665328d92d3005946c38d4a5bdd5a639365096a1e93bbaa73389cbfaefd1d934867b8201492985a51e3
|
@@ -26,7 +26,10 @@ module Workarea
|
|
26
26
|
#
|
27
27
|
def current_order=(order)
|
28
28
|
@current_order = order
|
29
|
-
|
29
|
+
|
30
|
+
if order.blank? || order.persisted?
|
31
|
+
cookies.permanent.signed[:order_id] = order&.id
|
32
|
+
end
|
30
33
|
end
|
31
34
|
|
32
35
|
# Removes the current order from the session.
|
@@ -8,7 +8,11 @@ module Workarea
|
|
8
8
|
|
9
9
|
def edit
|
10
10
|
reset = User::PasswordReset.find_by(token: params[:token]) rescue nil
|
11
|
-
|
11
|
+
|
12
|
+
unless reset
|
13
|
+
flash[:error] = t('workarea.storefront.flash_messages.password_reset_expired')
|
14
|
+
redirect_to forgot_password_path
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
def create
|
@@ -3,7 +3,7 @@
|
|
3
3
|
= render_schema_org(fulfillment_email_schema(@order, @package))
|
4
4
|
|
5
5
|
- content_for :preheader_text do
|
6
|
-
= t('workarea.storefront.email.
|
6
|
+
= t('workarea.storefront.email.order_shipped.heading', order_id: @order.id)
|
7
7
|
|
8
8
|
%tr
|
9
9
|
%td
|
@@ -10,6 +10,8 @@
|
|
10
10
|
.product-prices.product-prices--details
|
11
11
|
= render 'workarea/storefront/products/pricing', product: product
|
12
12
|
|
13
|
+
= append_partials('storefront.product_pricing_details', product: product)
|
14
|
+
|
13
15
|
- if product.description.present?
|
14
16
|
.product-details__description
|
15
17
|
%p= truncated_product_description(product, t('workarea.storefront.products.read_more'))
|
@@ -10,6 +10,8 @@
|
|
10
10
|
.product-prices.product-prices--details
|
11
11
|
= render 'workarea/storefront/products/pricing', product: product
|
12
12
|
|
13
|
+
= append_partials('storefront.product_pricing_details', product: product)
|
14
|
+
|
13
15
|
- if product.description.present?
|
14
16
|
.product-details__description
|
15
17
|
%p= truncated_product_description(product, t('workarea.storefront.products.read_more'))
|
data/config/locales/en.yml
CHANGED
@@ -210,14 +210,14 @@ en:
|
|
210
210
|
credit_card_update_error: There were errors updating your credit card.
|
211
211
|
credit_card_removed: Your credit card has been removed.
|
212
212
|
password_reset_expired: This password reset is expired.
|
213
|
-
password_reset_email_sent: If a valid
|
213
|
+
password_reset_email_sent: If a valid email address was entered, instructions to reset your password have been sent to "%{email}"
|
214
214
|
password_reset: Your password has been reset.
|
215
215
|
old_password_invalid: Your old password is not valid.
|
216
216
|
password_required: Password is required.
|
217
217
|
items_required: You must add an item to your cart to checkout
|
218
218
|
order_custom_pricing: Your cart has custom pricing, you cannot edit the contents of your cart.
|
219
219
|
download_unavailable: This download is no longer available. Contact customer support for more information.
|
220
|
-
no_available_shipping_options: There are no available shipping options for your shipping
|
220
|
+
no_available_shipping_options: There are no available shipping options for your shipping address.
|
221
221
|
|
222
222
|
forms:
|
223
223
|
required: '*'
|
@@ -123,6 +123,26 @@ module Workarea
|
|
123
123
|
|
124
124
|
assert_redirected_to(storefront.login_path)
|
125
125
|
end
|
126
|
+
|
127
|
+
def test_no_extra_order_id_cookies
|
128
|
+
user = create_user(password: 'Passw0rd!')
|
129
|
+
post storefront.login_path,
|
130
|
+
params: { email: user.email, password: 'Passw0rd!' }
|
131
|
+
|
132
|
+
follow_redirect!
|
133
|
+
assert(cookies[:order_id].blank?)
|
134
|
+
|
135
|
+
delete storefront.logout_path
|
136
|
+
|
137
|
+
follow_redirect!
|
138
|
+
assert(cookies[:order_id].blank?)
|
139
|
+
|
140
|
+
post storefront.login_path,
|
141
|
+
params: { email: user.email, password: 'Passw0rd!' }
|
142
|
+
|
143
|
+
follow_redirect!
|
144
|
+
assert(cookies[:order_id].blank?)
|
145
|
+
end
|
126
146
|
end
|
127
147
|
end
|
128
148
|
end
|
@@ -16,6 +16,16 @@ module Workarea
|
|
16
16
|
get storefront.category_path(create_category(active: false))
|
17
17
|
assert(response.ok?)
|
18
18
|
end
|
19
|
+
|
20
|
+
def test_not_accepting_per_page_param
|
21
|
+
products = [create_product, create_product]
|
22
|
+
category = create_category(product_ids: products.map(&:id))
|
23
|
+
|
24
|
+
get storefront.category_path(category, page: 1, per_page: 1)
|
25
|
+
assert(response.ok?)
|
26
|
+
assert_includes(response.body, storefront.product_path(products.first))
|
27
|
+
assert_includes(response.body, storefront.product_path(products.second))
|
28
|
+
end
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
@@ -345,6 +345,39 @@ module Workarea
|
|
345
345
|
|
346
346
|
assert(flash[:error].present?)
|
347
347
|
end
|
348
|
+
|
349
|
+
def test_not_setting_a_blank_tracking_email
|
350
|
+
cookies[:email] = 'foo@bar.com'
|
351
|
+
get storefront.checkout_shipping_path
|
352
|
+
assert_equal('foo@bar.com', cookies[:email])
|
353
|
+
end
|
354
|
+
|
355
|
+
def test_no_required_shipping_address_options_flash_message
|
356
|
+
product = create_product(name: 'Digital Product', variants: [{ sku: 'SKU' }])
|
357
|
+
create_fulfillment_sku(id: 'SKU', policy: :download, file: product_image_file)
|
358
|
+
|
359
|
+
post storefront.cart_items_path,
|
360
|
+
params: { product_id: product.id, sku: product.skus.first, quantity: 1 }
|
361
|
+
|
362
|
+
get storefront.checkout_addresses_path
|
363
|
+
|
364
|
+
patch storefront.checkout_addresses_path,
|
365
|
+
params: {
|
366
|
+
email: 'bcrouse@weblinc.com',
|
367
|
+
billing_address: {
|
368
|
+
first_name: 'Ben',
|
369
|
+
last_name: 'Crouse',
|
370
|
+
street: '12 N. 3rd St.',
|
371
|
+
city: 'Philadelphia',
|
372
|
+
region: 'PA',
|
373
|
+
postal_code: '19106',
|
374
|
+
country: 'US',
|
375
|
+
phone_number: '2159251800'
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
refute(flash[:error].present?)
|
380
|
+
end
|
348
381
|
end
|
349
382
|
end
|
350
383
|
end
|
@@ -13,7 +13,7 @@ module Workarea
|
|
13
13
|
|
14
14
|
def test_login
|
15
15
|
login(User.find(params[:user_id]))
|
16
|
-
self.current_order = Order.
|
16
|
+
self.current_order = Order.create!(id: params[:order_id]) if params[:order_id].present?
|
17
17
|
head :ok
|
18
18
|
end
|
19
19
|
|
@@ -87,6 +87,16 @@ module Workarea
|
|
87
87
|
assert_includes(response.body, 'Foo A')
|
88
88
|
assert_includes(response.body, 'Foo B')
|
89
89
|
end
|
90
|
+
|
91
|
+
def test_not_accepting_per_page_param
|
92
|
+
one = create_product(name: 'Foo A')
|
93
|
+
two = create_product(name: 'Foo B')
|
94
|
+
|
95
|
+
get storefront.search_path(q: 'foo', page: 1, per_page: 1)
|
96
|
+
assert(response.ok?)
|
97
|
+
assert_includes(response.body, storefront.product_path(one))
|
98
|
+
assert_includes(response.body, storefront.product_path(two))
|
99
|
+
end
|
90
100
|
end
|
91
101
|
end
|
92
102
|
end
|
@@ -271,6 +271,19 @@ module Workarea
|
|
271
271
|
headers: { 'HTTP_REFERER' => 'https://www.facebook.com/' }
|
272
272
|
assert_equal(google.id.to_s, response.headers['X-Workarea-Segments'])
|
273
273
|
end
|
274
|
+
|
275
|
+
def test_missing_email_cookies
|
276
|
+
user = create_user(password: 'w0rkArea!', tags: %w(foo))
|
277
|
+
segment = create_segment(rules: [Segment::Rules::Tags.new(tags: %w(foo))])
|
278
|
+
|
279
|
+
post storefront.login_path,
|
280
|
+
params: { email: user.email, password: 'w0rkArea!' }
|
281
|
+
|
282
|
+
cookies[:email] = nil
|
283
|
+
|
284
|
+
get storefront.current_user_path(format: 'json')
|
285
|
+
assert_equal(segment.id.to_s, response.headers['X-Workarea-Segments'])
|
286
|
+
end
|
274
287
|
end
|
275
288
|
end
|
276
289
|
end
|
@@ -31,6 +31,7 @@ module Workarea
|
|
31
31
|
|
32
32
|
def test_handles_a_missing_password_reset
|
33
33
|
get storefront.reset_password_path(token: 'foo')
|
34
|
+
assert(flash[:error].present?)
|
34
35
|
assert_redirected_to(storefront.forgot_password_path)
|
35
36
|
end
|
36
37
|
|
@@ -42,6 +43,24 @@ module Workarea
|
|
42
43
|
assert(flash[:error].present?)
|
43
44
|
assert(response.redirect?)
|
44
45
|
end
|
46
|
+
|
47
|
+
def test_expired_resets
|
48
|
+
post storefront.forgot_password_path, params: { email: 'passwords@workarea.com' }
|
49
|
+
first = User::PasswordReset.desc(:created_at).first
|
50
|
+
|
51
|
+
get storefront.reset_password_path(token: first.token)
|
52
|
+
assert(response.ok?)
|
53
|
+
|
54
|
+
post storefront.forgot_password_path, params: { email: 'passwords@workarea.com' }
|
55
|
+
second = User::PasswordReset.desc(:created_at).first
|
56
|
+
|
57
|
+
get storefront.reset_password_path(token: second.token)
|
58
|
+
assert(response.ok?)
|
59
|
+
|
60
|
+
get storefront.reset_password_path(token: first.token)
|
61
|
+
assert(flash[:error].present?)
|
62
|
+
assert_redirected_to(storefront.forgot_password_path)
|
63
|
+
end
|
45
64
|
end
|
46
65
|
end
|
47
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-storefront
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: workarea-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.5.
|
19
|
+
version: 3.5.13
|
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: 3.5.
|
26
|
+
version: 3.5.13
|
27
27
|
description: Provides user-facing ecommerce storefront functionality for the Workarea
|
28
28
|
Commerce Platform.
|
29
29
|
email:
|