workarea-storefront 3.5.10 → 3.5.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8ee66bdca09fe14b714c4593cecdd5a83f6dc256e294974e2314a480ae69c6a
4
- data.tar.gz: '0469acdaf83ebefbfd1364dbc1d45d1b1c4cebbdebc67ca95141e730c7485487'
3
+ metadata.gz: 2d17dfbda0e576cfb677b85dfeeec873e3298a1bb50cfdaba1e2718230d48cb7
4
+ data.tar.gz: 31fa8f33a31315e15944a7a1849504cf476f1cfbc3592e22a7e1c0447aaf5136
5
5
  SHA512:
6
- metadata.gz: d684e7669a8eff46a3cdc6ac95d778159621a93dd4341242dfd51ac6237e5a8de79edad7aeecc1aa9201744b3cbfd33bebc757bb8fc226d93a0c705f5944e1c7
7
- data.tar.gz: 654ee0e80589bccd1cb1ef3be7b6fcdab0f9bc58610685e5883f094c96325b54caf0a5e5acfa2ca1e24da5e6c2f1282001427ede7b24ac120f192125049441a9
6
+ metadata.gz: 1b5dd4aa87edc5d005e42a759fa7134269e959da444ac58e66de114f8d12fbb70092b788f60222cb2ebf0ed99c15bdea2987b4fb4af06f2c73ada22cee676e57
7
+ data.tar.gz: 73204e45143a99faae0979672ab3250d5fb62e5f8176eee60b7d58f74e82bbabb9dde03b12b24c5286bb018a26555a7e06a267daab45ca2e4aae4c2a03f7e1eb
@@ -26,7 +26,10 @@ module Workarea
26
26
  #
27
27
  def current_order=(order)
28
28
  @current_order = order
29
- cookies.permanent.signed[:order_id] = order&.id
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
@@ -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.new(id: params[:order_id]) if params[:order_id].present?
16
+ self.current_order = Order.create!(id: params[:order_id]) if params[:order_id].present?
17
17
  head :ok
18
18
  end
19
19
 
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.10
4
+ version: 3.5.11
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-04-28 00:00:00.000000000 Z
11
+ date: 2020-05-13 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.10
19
+ version: 3.5.11
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.10
26
+ version: 3.5.11
27
27
  description: Provides user-facing ecommerce storefront functionality for the Workarea
28
28
  Commerce Platform.
29
29
  email: