workarea-storefront 3.5.11 → 3.5.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d17dfbda0e576cfb677b85dfeeec873e3298a1bb50cfdaba1e2718230d48cb7
4
- data.tar.gz: 31fa8f33a31315e15944a7a1849504cf476f1cfbc3592e22a7e1c0447aaf5136
3
+ metadata.gz: 34dae4a866fa8dc6c2bed7e2c9da094199bdfda6f2859ea718e77310756bc875
4
+ data.tar.gz: 572eeb5fa03e1a3dba3683c83eb21844e372e1c1a4cb65dc771a8babe48970b6
5
5
  SHA512:
6
- metadata.gz: 1b5dd4aa87edc5d005e42a759fa7134269e959da444ac58e66de114f8d12fbb70092b788f60222cb2ebf0ed99c15bdea2987b4fb4af06f2c73ada22cee676e57
7
- data.tar.gz: 73204e45143a99faae0979672ab3250d5fb62e5f8176eee60b7d58f74e82bbabb9dde03b12b24c5286bb018a26555a7e06a267daab45ca2e4aae4c2a03f7e1eb
6
+ metadata.gz: c7a9687e4759d591490c9d109ba617c09d88727d0412a51e611d4d5aad60c31f4da51b01fc677dde2b1c3db2f89856b880e7ad30a001898e9e14968895e43a9c
7
+ data.tar.gz: 323651e9ccedecab9d6be53a4dc2040ec8d6f8b8af4d2968cc34e82d66f15651937a83ac6ba42a6606363d773dfc8efde346874ce6d9ecd2dfefd3a8ab1283a3
@@ -46,6 +46,8 @@ module Workarea
46
46
  end
47
47
 
48
48
  def validate_shipping_options
49
+ return unless current_order.requires_shipping?
50
+
49
51
  available_options = Workarea::Storefront::CartViewModel.new(current_order).shipping_options
50
52
 
51
53
  if available_options.empty?
@@ -44,7 +44,7 @@ module Workarea
44
44
  segment_ids: current_segments.map(&:id)
45
45
  )
46
46
 
47
- update_tracking!(email: current_order.email)
47
+ update_tracking!(email: current_order.email) unless current_order.email.blank?
48
48
  end
49
49
 
50
50
  def with_order_lock
@@ -61,11 +61,8 @@ module Workarea
61
61
  params[:credit_card].permit(
62
62
  :first_name,
63
63
  :last_name,
64
- :number,
65
- :month,
66
- :year,
67
- :cvv,
68
- :default
64
+ :default,
65
+ *Workarea.config.credit_card_attributes
69
66
  )
70
67
  end
71
68
 
@@ -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
@@ -3,7 +3,9 @@ require 'test_helper'
3
3
  module Workarea
4
4
  module Storefront
5
5
  class PlaceOrderIntegrationTest < Workarea::IntegrationTest
6
- setup do
6
+ setup :setup_checkout
7
+
8
+ def setup_checkout
7
9
  create_tax_category(
8
10
  name: 'Sales Tax',
9
11
  code: '001',
@@ -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.11
4
+ version: 3.5.16
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-05-13 00:00:00.000000000 Z
11
+ date: 2020-07-22 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.11
19
+ version: 3.5.16
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.11
26
+ version: 3.5.16
27
27
  description: Provides user-facing ecommerce storefront functionality for the Workarea
28
28
  Commerce Platform.
29
29
  email: