workarea-storefront 3.5.10 → 3.5.15
Sign up to get free protection for your applications and to get access to all the features.
- 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/test/integration/workarea/storefront/accounts_integration_test.rb +20 -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/segments_integration_test.rb +13 -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: 289c18606364caedb6713122b572dcb4040526a2082fd67e6628a8565c39d253
|
4
|
+
data.tar.gz: d4fb9525f5269f1525ee8a544f334103fc41ad6ae82ab20aa8f7e3cc7b65d000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a4f0962e3c17621d771949e9dc3e2bd92ef59fa02d916670a2104ab7a0158254a66e4e0b93ec28270846e2163e7990ac6cbc9cb8bbd07b3bb9171d8dd02d43
|
7
|
+
data.tar.gz: 441493667de93080551f774b54cb0295a223711e80d6cc9df186fc9b5b9f6e0b8336c5522a9181de303babace951522add351d5a2279f306612f8b5b18bd8150
|
@@ -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.
|
@@ -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
|
@@ -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
|
|
@@ -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
|
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.15
|
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-07-07 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.15
|
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.15
|
27
27
|
description: Provides user-facing ecommerce storefront functionality for the Workarea
|
28
28
|
Commerce Platform.
|
29
29
|
email:
|