workarea-storefront 3.5.19 → 3.5.25
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/cart_items_controller.rb +2 -1
- data/app/view_models/workarea/storefront/product_view_model.rb +2 -0
- data/test/integration/workarea/storefront/cart_items_integration_test.rb +12 -0
- data/test/integration/workarea/storefront/store_credit_integration_test.rb +3 -1
- data/test/system/workarea/storefront/content_system_test.rb +1 -1
- data/test/system/workarea/storefront/credit_cards_system_test.rb +1 -1
- data/test/system/workarea/storefront/navigation_system_test.rb +2 -2
- data/test/system/workarea/storefront/pagination_system_test.rb +6 -6
- data/test/view_models/workarea/storefront/product_view_model_test.rb +8 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af9aad98b9e39b79b82cb89b56f15e2344a53949d23f0b2245a0070b6e84e88a
|
4
|
+
data.tar.gz: 26ea146188cc199f30abc1d25836b93ecfa10ba6f931e4c8731a6007c0ab44fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4d5371fe0384167e55b438d58a3507a9281e04dd07f085bc1e5b20a5260d85d0a0912b82e448d6570c7e00996234d91c9e7a8824c29203b981b0b4de3a7c222
|
7
|
+
data.tar.gz: e5ea7e5dd2f7a82b4a69e52c1104c2c427dbb1f69fbf40d4255162bb07e6fa58cb50d08740e3a39fe1fe71fa10955a5effdba9718bb57db81277ffbffa905451
|
@@ -11,13 +11,14 @@ module Workarea
|
|
11
11
|
after_action :check_inventory, except: :create
|
12
12
|
|
13
13
|
def create
|
14
|
+
@cart = CartViewModel.new(current_order, view_model_options)
|
15
|
+
|
14
16
|
# TODO: for v4, use AddItemToCart for this.
|
15
17
|
if current_order.add_item(item_params.to_h.merge(item_details.to_h))
|
16
18
|
check_inventory
|
17
19
|
|
18
20
|
Pricing.perform(current_order, current_shippings)
|
19
21
|
|
20
|
-
@cart = CartViewModel.new(current_order, view_model_options)
|
21
22
|
@item = OrderItemViewModel.wrap(
|
22
23
|
current_order.items.find_existing(
|
23
24
|
item_params[:sku],
|
@@ -47,6 +47,18 @@ module Workarea
|
|
47
47
|
assert_equal(5.to_m, order.items.first.total_price)
|
48
48
|
end
|
49
49
|
|
50
|
+
def test_fail_to_add_an_item
|
51
|
+
post storefront.cart_items_path,
|
52
|
+
params: {
|
53
|
+
product_id: @product.id,
|
54
|
+
sku: 'SKU1',
|
55
|
+
quantity: -1
|
56
|
+
}
|
57
|
+
|
58
|
+
assert_response(:success)
|
59
|
+
assert_empty(Order.all)
|
60
|
+
end
|
61
|
+
|
50
62
|
def test_adding_product_with_shared_skus
|
51
63
|
product_2 = Catalog::Product.create!(name: 'Product', variants: [{ sku: 'SKU1' }])
|
52
64
|
|
@@ -5,7 +5,9 @@ module Workarea
|
|
5
5
|
class StoreCreditIntegrationTest < Workarea::IntegrationTest
|
6
6
|
include Storefront::IntegrationTest
|
7
7
|
|
8
|
-
|
8
|
+
setup :setup_supporting_data
|
9
|
+
|
10
|
+
def setup_supporting_data
|
9
11
|
@user = create_user(email: 'bcrouse@workarea.com', password: 'W3bl1nc!')
|
10
12
|
|
11
13
|
@tax = create_tax_category(
|
@@ -54,7 +54,7 @@ module Workarea
|
|
54
54
|
assert_current_path(storefront.root_path)
|
55
55
|
|
56
56
|
page.execute_script("$('body').trigger('click');")
|
57
|
-
|
57
|
+
refute_text('Foo')
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_left_navigation
|
@@ -66,7 +66,7 @@ module Workarea
|
|
66
66
|
|
67
67
|
secondary.navigable.update_attributes!(active: false)
|
68
68
|
visit storefront.page_path(primary.navigable)
|
69
|
-
|
69
|
+
refute_text('Foo')
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
@@ -59,7 +59,7 @@ module Workarea
|
|
59
59
|
|
60
60
|
scroll_to_bottom
|
61
61
|
|
62
|
-
|
62
|
+
refute_text(t('workarea.storefront.pagination.next_page'))
|
63
63
|
click_link t('workarea.storefront.pagination.load_more')
|
64
64
|
|
65
65
|
assert_current_path(storefront.category_path(category))
|
@@ -70,7 +70,7 @@ module Workarea
|
|
70
70
|
assert(page.has_content?('Product 5'))
|
71
71
|
assert(page.has_content?('Product 6'))
|
72
72
|
|
73
|
-
|
73
|
+
refute_text(t('workarea.storefront.pagination.load_more'))
|
74
74
|
|
75
75
|
find('a', text: 'Product 6').click
|
76
76
|
page.execute_script("history.back()")
|
@@ -79,7 +79,7 @@ module Workarea
|
|
79
79
|
|
80
80
|
wait_for_xhr
|
81
81
|
|
82
|
-
|
82
|
+
refute_text(t('workarea.storefront.pagination.load_more'))
|
83
83
|
|
84
84
|
assert_match(/PROD1.*PROD2.*PROD3.*PROD4.*PROD5.*PROD6/m, page.html)
|
85
85
|
end
|
@@ -95,7 +95,7 @@ module Workarea
|
|
95
95
|
|
96
96
|
scroll_to_bottom
|
97
97
|
|
98
|
-
|
98
|
+
refute_text(t('workarea.storefront.pagination.next_page'))
|
99
99
|
click_link t('workarea.storefront.pagination.load_more')
|
100
100
|
|
101
101
|
assert_current_path(storefront.search_path(q: 'Product'))
|
@@ -106,7 +106,7 @@ module Workarea
|
|
106
106
|
assert(page.has_content?('Product 5'))
|
107
107
|
assert(page.has_content?('Product 6'))
|
108
108
|
|
109
|
-
|
109
|
+
refute_text(t('workarea.storefront.pagination.load_more'))
|
110
110
|
|
111
111
|
find('a', text: 'Product 6').click
|
112
112
|
page.execute_script("history.back()")
|
@@ -115,7 +115,7 @@ module Workarea
|
|
115
115
|
|
116
116
|
wait_for_xhr
|
117
117
|
|
118
|
-
|
118
|
+
refute_text(t('workarea.storefront.pagination.load_more'))
|
119
119
|
|
120
120
|
assert(page.has_content?('Product 1'))
|
121
121
|
assert(page.has_content?('Product 2'))
|
@@ -15,6 +15,14 @@ module Workarea
|
|
15
15
|
view_model = ProductViewModel.wrap(@product, one: '1')
|
16
16
|
assert_instance_of(ProductTemplates::OptionSelectsViewModel, view_model)
|
17
17
|
assert_equal('1', view_model.options[:one])
|
18
|
+
|
19
|
+
Workarea.with_config do |config|
|
20
|
+
config.product_templates << :no_view_model
|
21
|
+
@product.template = 'no_view_model'
|
22
|
+
view_model = ProductViewModel.wrap(@product, one: '1')
|
23
|
+
|
24
|
+
assert_kind_of(ProductViewModel, view_model)
|
25
|
+
end
|
18
26
|
end
|
19
27
|
|
20
28
|
def test_cache_key
|
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.25
|
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-12-23 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.25
|
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.25
|
27
27
|
description: Provides user-facing ecommerce storefront functionality for the Workarea
|
28
28
|
Commerce Platform.
|
29
29
|
email:
|
@@ -734,7 +734,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
734
734
|
- !ruby/object:Gem::Version
|
735
735
|
version: '0'
|
736
736
|
requirements: []
|
737
|
-
rubygems_version: 3.
|
737
|
+
rubygems_version: 3.2.3
|
738
738
|
signing_key:
|
739
739
|
specification_version: 4
|
740
740
|
summary: Storefront for the Workarea Commerce Platform
|