workarea-storefront 3.5.0.beta.1 → 3.5.0
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/application_controller.rb +0 -1
- data/app/view_models/workarea/storefront/product_view_model.rb +2 -2
- data/test/integration/workarea/storefront/checkout_side_effects_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/checkouts_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/downloads_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/impersonations_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/order_data_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/place_order_integration_test.rb +4 -4
- data/test/integration/workarea/storefront/placing_order_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/segments_integration_test.rb +26 -0
- data/test/integration/workarea/storefront/store_credit_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/users/credit_cards_integration_test.rb +2 -2
- data/test/view_models/workarea/storefront/product_view_model_test.rb +2 -2
- metadata +6 -7
- data/test/system/workarea/storefront/digital_products_system_test.rb +0 -142
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d693a55944192cf23fd6341859c366277a01988b2b5ff34040183828ca6c12c7
|
4
|
+
data.tar.gz: 1e6c57484728ebca2384547e5e4ccd1dfceae3847eac886e3bb1f28c342758e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7764b11b9cd1ed0f1b62ded7893a4bed21c8d7ae847a6a578f0a39252b09a9334a84a3fcc00f3a9c236ea6ee70fc24158fe0f5b9a7a23ea2ca37f9ff890c9b7c
|
7
|
+
data.tar.gz: 2187e4020b5486ae615e93860cc6015d62aa65925517130fd1181a418bd6bfae70bccc5616e6774224d66a3e50928bab1e0f84fa0ccdcf87decec153d5d8fa73
|
@@ -192,9 +192,9 @@ module Workarea
|
|
192
192
|
if current_variant.present?
|
193
193
|
fulfillment_skus
|
194
194
|
.detect { |sku| sku.id == current_variant.sku }
|
195
|
-
.
|
195
|
+
.shipping?
|
196
196
|
else
|
197
|
-
fulfillment_skus.any?(&:
|
197
|
+
fulfillment_skus.any?(&:shipping?)
|
198
198
|
end
|
199
199
|
end
|
200
200
|
end
|
@@ -74,7 +74,7 @@ module Workarea
|
|
74
74
|
assert_equal('Crouse', credit_card.last_name)
|
75
75
|
assert_equal('XXXX-XXXX-XXXX-1', credit_card.display_number)
|
76
76
|
assert_equal(1, credit_card.month)
|
77
|
-
assert_equal(
|
77
|
+
assert_equal(next_year, credit_card.year)
|
78
78
|
refute(credit_card.token.blank?)
|
79
79
|
|
80
80
|
complete_checkout('bcrouse@workarea.com', 'W3bl1nc!')
|
@@ -100,7 +100,7 @@ module Workarea
|
|
100
100
|
assert_equal('Test Card', payment.credit_card.issuer)
|
101
101
|
assert_equal('XXXX-XXXX-XXXX-1', payment.credit_card.display_number)
|
102
102
|
assert_equal(1, payment.credit_card.month)
|
103
|
-
assert_equal(
|
103
|
+
assert_equal(next_year, payment.credit_card.year)
|
104
104
|
refute(payment.credit_card.token.blank?)
|
105
105
|
assert(payment.credit_card.saved_card_id.blank?)
|
106
106
|
|
@@ -66,7 +66,7 @@ module Workarea
|
|
66
66
|
credit_card: {
|
67
67
|
number: '1',
|
68
68
|
month: 1,
|
69
|
-
year:
|
69
|
+
year: next_year,
|
70
70
|
cvv: '999'
|
71
71
|
}
|
72
72
|
}
|
@@ -81,7 +81,7 @@ module Workarea
|
|
81
81
|
credit_card: {
|
82
82
|
number: '2',
|
83
83
|
month: 1,
|
84
|
-
year:
|
84
|
+
year: next_year,
|
85
85
|
cvv: '999'
|
86
86
|
}
|
87
87
|
}
|
@@ -97,7 +97,7 @@ module Workarea
|
|
97
97
|
credit_card: {
|
98
98
|
number: '1',
|
99
99
|
month: 1,
|
100
|
-
year:
|
100
|
+
year: next_year,
|
101
101
|
cvv: '999'
|
102
102
|
}
|
103
103
|
}
|
@@ -117,7 +117,7 @@ module Workarea
|
|
117
117
|
credit_card: {
|
118
118
|
number: '1',
|
119
119
|
month: 1,
|
120
|
-
year:
|
120
|
+
year: next_year,
|
121
121
|
cvv: '999'
|
122
122
|
}
|
123
123
|
}
|
@@ -245,6 +245,32 @@ module Workarea
|
|
245
245
|
refute_match(/public/, response.headers['Cache-Control'])
|
246
246
|
assert_equal('true', response.headers['X-Workarea-Segmented-Content'])
|
247
247
|
end
|
248
|
+
|
249
|
+
def test_referrer_based_segments
|
250
|
+
google = create_segment(rules: [Segment::Rules::TrafficReferrer.new(source: %w(Google))])
|
251
|
+
facebook = create_segment(rules: [Segment::Rules::TrafficReferrer.new(url: 'facebook')])
|
252
|
+
|
253
|
+
get storefront.current_user_path(format: 'json'),
|
254
|
+
headers: { 'HTTP_REFERER' => 'https://www.google.com/' }
|
255
|
+
assert_equal(google.id.to_s, response.headers['X-Workarea-Segments'])
|
256
|
+
|
257
|
+
get storefront.current_user_path(format: 'json'),
|
258
|
+
headers: { 'HTTP_REFERER' => 'https://www.facebook.com/' }
|
259
|
+
assert_equal(facebook.id.to_s, response.headers['X-Workarea-Segments'])
|
260
|
+
|
261
|
+
cookies[:workarea_referrer] = 'https://www.google.com/'
|
262
|
+
get storefront.current_user_path(format: 'json')
|
263
|
+
assert_equal(google.id.to_s, response.headers['X-Workarea-Segments'])
|
264
|
+
|
265
|
+
cookies[:workarea_referrer] = 'https://www.facebook.com/'
|
266
|
+
get storefront.current_user_path(format: 'json')
|
267
|
+
assert_equal(facebook.id.to_s, response.headers['X-Workarea-Segments'])
|
268
|
+
|
269
|
+
cookies[:workarea_referrer] = 'https://www.google.com/'
|
270
|
+
get storefront.current_user_path(format: 'json'),
|
271
|
+
headers: { 'HTTP_REFERER' => 'https://www.facebook.com/' }
|
272
|
+
assert_equal(google.id.to_s, response.headers['X-Workarea-Segments'])
|
273
|
+
end
|
248
274
|
end
|
249
275
|
end
|
250
276
|
end
|
@@ -98,7 +98,7 @@ module Workarea
|
|
98
98
|
assert_equal('Test Card', payment.credit_card.issuer)
|
99
99
|
assert_equal('XXXX-XXXX-XXXX-1', payment.credit_card.display_number)
|
100
100
|
assert_equal(1, payment.credit_card.month)
|
101
|
-
assert_equal(
|
101
|
+
assert_equal(next_year, payment.credit_card.year)
|
102
102
|
assert_equal(13.19.to_m, payment.credit_card.amount)
|
103
103
|
refute(payment.credit_card.token.blank?)
|
104
104
|
assert_equal(1, payment.credit_card.transactions.length)
|
@@ -49,14 +49,14 @@ module Workarea
|
|
49
49
|
params: {
|
50
50
|
credit_card: {
|
51
51
|
month: '2',
|
52
|
-
year:
|
52
|
+
year: next_year.to_s,
|
53
53
|
cvv: '999'
|
54
54
|
}
|
55
55
|
}
|
56
56
|
|
57
57
|
credit_card.reload
|
58
58
|
assert_equal(2, credit_card.month)
|
59
|
-
assert_equal(
|
59
|
+
assert_equal(next_year, credit_card.year)
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_removes_credit_cards
|
@@ -233,8 +233,8 @@ module Workarea
|
|
233
233
|
|
234
234
|
def test_requires_shipping?
|
235
235
|
product = create_product(variants: [{ sku: 'SKU1' }, { sku: 'SKU2' }])
|
236
|
-
sku_1 = create_fulfillment_sku(id: 'SKU1', policy: '
|
237
|
-
sku_2 = create_fulfillment_sku(id: 'SKU2', policy: '
|
236
|
+
sku_1 = create_fulfillment_sku(id: 'SKU1', policy: 'download', file: product_image_file)
|
237
|
+
sku_2 = create_fulfillment_sku(id: 'SKU2', policy: 'shipping')
|
238
238
|
|
239
239
|
view_model = ProductViewModel.wrap(product)
|
240
240
|
assert(view_model.requires_shipping?)
|
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.0
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-26 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.0
|
19
|
+
version: 3.5.0
|
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.0
|
26
|
+
version: 3.5.0
|
27
27
|
description: Provides user-facing ecommerce storefront functionality for the Workarea
|
28
28
|
Commerce Platform.
|
29
29
|
email:
|
@@ -657,7 +657,6 @@ files:
|
|
657
657
|
- test/system/workarea/storefront/content_system_test.rb
|
658
658
|
- test/system/workarea/storefront/credit_cards_system_test.rb
|
659
659
|
- test/system/workarea/storefront/customer_service_system_test.rb
|
660
|
-
- test/system/workarea/storefront/digital_products_system_test.rb
|
661
660
|
- test/system/workarea/storefront/discounting_multiple_system_test.rb
|
662
661
|
- test/system/workarea/storefront/discounting_system_test.rb
|
663
662
|
- test/system/workarea/storefront/download_system_test.rb
|
@@ -730,9 +729,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
730
729
|
version: '0'
|
731
730
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
732
731
|
requirements:
|
733
|
-
- - "
|
732
|
+
- - ">="
|
734
733
|
- !ruby/object:Gem::Version
|
735
|
-
version:
|
734
|
+
version: '0'
|
736
735
|
requirements: []
|
737
736
|
rubygems_version: 3.0.6
|
738
737
|
signing_key:
|
@@ -1,142 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Workarea
|
4
|
-
module Storefront
|
5
|
-
# TODO: delete this for v3.6
|
6
|
-
# Leaving this in v3.5 for compatibility with existing builds
|
7
|
-
class DigitalProductsSystemTest < Workarea::SystemTest
|
8
|
-
include Storefront::SystemTest
|
9
|
-
|
10
|
-
def test_checking_out_with_a_digital_product
|
11
|
-
setup_checkout_specs
|
12
|
-
|
13
|
-
Order.first.items.delete_all
|
14
|
-
|
15
|
-
product = create_product(
|
16
|
-
name: 'Digital Product',
|
17
|
-
digital: true,
|
18
|
-
variants: [
|
19
|
-
{ sku: 'SKU1', regular: 10.to_m },
|
20
|
-
{ sku: 'SKU2', regular: 15.to_m },
|
21
|
-
{ sku: 'SKU3', regular: 25.to_m }
|
22
|
-
]
|
23
|
-
)
|
24
|
-
|
25
|
-
visit storefront.product_path(product)
|
26
|
-
|
27
|
-
within '.product-details__add-to-cart-form' do
|
28
|
-
select product.skus.first, from: 'sku'
|
29
|
-
click_button t('workarea.storefront.products.add_to_cart')
|
30
|
-
end
|
31
|
-
|
32
|
-
assert(page.has_content?('Success'))
|
33
|
-
|
34
|
-
start_guest_checkout
|
35
|
-
|
36
|
-
assert_current_path(storefront.checkout_addresses_path)
|
37
|
-
|
38
|
-
fill_in_email
|
39
|
-
fill_in_billing_address
|
40
|
-
click_button t('workarea.storefront.checkouts.continue_to_payment')
|
41
|
-
|
42
|
-
assert_current_path(storefront.checkout_payment_path)
|
43
|
-
assert(page.has_content?('Success'))
|
44
|
-
|
45
|
-
fill_in_credit_card
|
46
|
-
click_button t('workarea.storefront.checkouts.place_order')
|
47
|
-
|
48
|
-
assert_current_path(storefront.checkout_confirmation_path)
|
49
|
-
assert(page.has_content?('Success'))
|
50
|
-
assert(page.has_content?(t('workarea.storefront.flash_messages.order_placed')))
|
51
|
-
assert(page.has_content?(Order.first.id))
|
52
|
-
|
53
|
-
assert(page.has_content?('1019 S. 47th St.'))
|
54
|
-
assert(page.has_content?('Philadelphia'))
|
55
|
-
assert(page.has_content?('PA'))
|
56
|
-
assert(page.has_content?('19143'))
|
57
|
-
|
58
|
-
assert(page.has_content?('Test Card'))
|
59
|
-
assert(page.has_content?('XX-1'))
|
60
|
-
|
61
|
-
assert(page.has_content?('Digital Product'))
|
62
|
-
assert(page.has_content?('$10.00'))
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_order_not_requiring_shipping
|
66
|
-
setup_checkout_specs
|
67
|
-
start_guest_checkout
|
68
|
-
|
69
|
-
create_shipping_service(
|
70
|
-
name: 'Next Day',
|
71
|
-
tax_code: '001',
|
72
|
-
rates: [{ price: 20.to_m }]
|
73
|
-
)
|
74
|
-
|
75
|
-
assert_current_path(storefront.checkout_addresses_path)
|
76
|
-
fill_in_email
|
77
|
-
fill_in_shipping_address
|
78
|
-
|
79
|
-
uncheck 'same_as_shipping'
|
80
|
-
fill_in_billing_address
|
81
|
-
|
82
|
-
click_button t('workarea.storefront.checkouts.continue_to_shipping')
|
83
|
-
|
84
|
-
assert_current_path(storefront.checkout_shipping_path)
|
85
|
-
click_button t('workarea.storefront.checkouts.continue_to_payment')
|
86
|
-
|
87
|
-
assert_current_path(storefront.checkout_payment_path)
|
88
|
-
assert(page.has_content?('Success'))
|
89
|
-
|
90
|
-
visit storefront.checkout_shipping_path
|
91
|
-
choose "shipping_service_Next_Day"
|
92
|
-
click_button t('workarea.storefront.checkouts.continue_to_payment')
|
93
|
-
|
94
|
-
assert_current_path(storefront.checkout_payment_path)
|
95
|
-
assert(page.has_content?('Success'))
|
96
|
-
|
97
|
-
# switch to digital product
|
98
|
-
|
99
|
-
Order.first.items.delete_all
|
100
|
-
|
101
|
-
product = create_product(
|
102
|
-
name: 'Digital Product',
|
103
|
-
digital: true,
|
104
|
-
variants: [
|
105
|
-
{ sku: 'SKU1', regular: 10.to_m },
|
106
|
-
{ sku: 'SKU2', regular: 15.to_m },
|
107
|
-
{ sku: 'SKU3', regular: 25.to_m }
|
108
|
-
]
|
109
|
-
)
|
110
|
-
|
111
|
-
visit storefront.product_path(product)
|
112
|
-
|
113
|
-
within '.product-details__add-to-cart-form' do
|
114
|
-
select product.skus.first, from: 'sku'
|
115
|
-
click_button t('workarea.storefront.products.add_to_cart')
|
116
|
-
end
|
117
|
-
|
118
|
-
click_link t('workarea.storefront.carts.checkout')
|
119
|
-
|
120
|
-
assert_current_path(storefront.checkout_addresses_path)
|
121
|
-
|
122
|
-
fill_in_email
|
123
|
-
fill_in_billing_address
|
124
|
-
click_button t('workarea.storefront.checkouts.continue_to_payment')
|
125
|
-
|
126
|
-
assert_current_path(storefront.checkout_payment_path)
|
127
|
-
assert(page.has_content?('Success'))
|
128
|
-
|
129
|
-
assert(page.has_content?('1019 S. 47th St.'))
|
130
|
-
assert(page.has_content?('Philadelphia'))
|
131
|
-
assert(page.has_content?('PA'))
|
132
|
-
assert(page.has_content?('19143'))
|
133
|
-
|
134
|
-
assert(page.has_no_content?("#{t('workarea.storefront.orders.tax')} $1.40"))
|
135
|
-
assert(page.has_no_content?("#{t('workarea.storefront.orders.total')} $31.40"))
|
136
|
-
assert(page.has_content?("#{t('workarea.storefront.orders.shipping')} #{t('workarea.storefront.checkouts.not_applicable')}"))
|
137
|
-
assert(page.has_content?("#{t('workarea.storefront.orders.tax')} $0.00"))
|
138
|
-
assert(page.has_content?("#{t('workarea.storefront.orders.total')} $10.00"))
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|