solidus_seo 1.1.1 → 1.1.2

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: 216bf7f2c50a2e4513308e4aa12f7f3685f4aa01621ffc2f8d0a025a4a4b88d2
4
- data.tar.gz: f7106060098a781ec08ba7c02447738d511e39bf0c3be675aafc1a4b837aa69c
3
+ metadata.gz: b271de06999564680b05f6bc567792f8bf7fa7e6c5f6724657e99c11b49f9863
4
+ data.tar.gz: 6b02664bd4631e08156e8f844e0e8c366a164d59a2c4cda90e4e2f52f65a752e
5
5
  SHA512:
6
- metadata.gz: 89bd816d982a8d8c8358f2e769ad5d030ce141097e0067a6b585e0bdfb3454ba88bf08c129c913baf6c5754c3465b8040cb22bb7c00db36f28aabc650340e1b2
7
- data.tar.gz: 6c05b6024066f4a6b36299f077883fc2086a0b9fba78415368a8b55662142214bdd006486330c821c4a94496aa699e581f2f6cfeb1a6e155bdc30d00782f6b76
6
+ metadata.gz: cf416b0189fde7be68c93ededdf8a1db518e4df9c9f1df826e54c5880654c6340413846ad318103aa201092cbdea1b72109d373a0894d0a5e4c97303d1c547c5
7
+ data.tar.gz: 71d3bfe67f0bf775289419f2e0cc1e70cac2719d8b54b17c083f5253350c83cd6d039ad57bbfdb8330aa4cb38266bc1f3a88cd6c97460786239c0a6c950e7246
@@ -26,6 +26,7 @@ module Spree
26
26
  cart_diff = cart_diff.map do |variant_sku, quantity|
27
27
  variant_hash = cart_diff_variant_payload(variant_sku)
28
28
  variant_hash[:quantity] = quantity
29
+ variant_hash[:amount] = quantity * variant_hash[:price]
29
30
 
30
31
  [variant_sku, variant_hash]
31
32
  end.to_h
@@ -24,6 +24,7 @@ if order.present?
24
24
 
25
25
  if flash[:added_to_cart].present?
26
26
  event_data[:added_to_cart] = {
27
+ value: flash[:added_to_cart].sum { |sku, hash| hash['amount'].to_d },
27
28
  currency: order.currency,
28
29
  content_type: 'product',
29
30
  contents: flash[:added_to_cart].map do |variant_sku, variant|
@@ -31,7 +31,7 @@ if order.present?
31
31
 
32
32
  if flash[:added_to_cart].present?
33
33
  event_data[:added_to_cart] = {
34
- value: order.total,
34
+ value: flash[:added_to_cart].sum { |sku, hash| hash['amount'].to_d },
35
35
  currency: order.currency,
36
36
  order_id: order.number,
37
37
  line_items: flash[:added_to_cart].map do |variant_sku, variant|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusSeo
4
- VERSION = '1.1.1'
4
+ VERSION = '1.1.2'
5
5
  end
data/spec/examples.txt CHANGED
@@ -1,40 +1,40 @@
1
1
  example_id | status | run_time |
2
2
  ------------------------------------------------- | ------- | --------------- |
3
- ./spec/features/add_to_cart_spec.rb[1:1:1] | passed | 0.70714 seconds |
4
- ./spec/features/add_to_cart_spec.rb[1:2:1] | passed | 0.91242 seconds |
5
- ./spec/features/add_to_cart_spec.rb[1:2:2] | passed | 0.81584 seconds |
6
- ./spec/features/checkout_complete_spec.rb[1:1:1] | passed | 0.79057 seconds |
7
- ./spec/features/checkout_complete_spec.rb[1:2:1] | passed | 0.60349 seconds |
8
- ./spec/features/checkout_complete_spec.rb[1:3:1] | passed | 0.67453 seconds |
9
- ./spec/features/checkout_complete_spec.rb[1:4:1] | passed | 1.34 seconds |
10
- ./spec/features/checkout_initiated_spec.rb[1:1:1] | pending | 4.43 seconds |
11
- ./spec/features/checkout_initiated_spec.rb[1:2:1] | pending | 0.14919 seconds |
12
- ./spec/features/checkout_initiated_spec.rb[1:3:1] | passed | 4.36 seconds |
13
- ./spec/features/checkout_initiated_spec.rb[1:4:1] | pending | 0.1462 seconds |
14
- ./spec/features/homepage_spec.rb[1:1:1] | passed | 0.29976 seconds |
15
- ./spec/features/homepage_spec.rb[1:1:2] | passed | 0.27 seconds |
16
- ./spec/features/homepage_spec.rb[1:2:1] | passed | 0.27712 seconds |
17
- ./spec/features/homepage_spec.rb[1:2:2] | passed | 0.2885 seconds |
18
- ./spec/features/homepage_spec.rb[1:3:1] | passed | 0.2833 seconds |
19
- ./spec/features/homepage_spec.rb[1:3:2] | passed | 0.34543 seconds |
20
- ./spec/features/homepage_spec.rb[1:4:1:1] | passed | 0.34652 seconds |
21
- ./spec/features/product_page_spec.rb[1:1:1] | passed | 0.49201 seconds |
22
- ./spec/features/product_page_spec.rb[1:1:2] | passed | 0.33732 seconds |
23
- ./spec/features/product_page_spec.rb[1:1:3] | passed | 0.44211 seconds |
24
- ./spec/features/product_page_spec.rb[1:2:1] | passed | 0.33363 seconds |
25
- ./spec/features/product_page_spec.rb[1:2:2:1] | passed | 0.37959 seconds |
26
- ./spec/features/product_page_spec.rb[1:2:3:1] | passed | 0.35276 seconds |
27
- ./spec/features/product_page_spec.rb[1:3:1] | passed | 0.38382 seconds |
28
- ./spec/features/product_page_spec.rb[1:3:2] | passed | 0.44302 seconds |
29
- ./spec/features/product_page_spec.rb[1:3:3] | passed | 0.3563 seconds |
30
- ./spec/features/product_page_spec.rb[1:4:1:1] | passed | 0.43342 seconds |
31
- ./spec/features/product_page_spec.rb[1:4:2:1] | passed | 0.51922 seconds |
32
- ./spec/features/taxon_page_spec.rb[1:1:1] | passed | 0.37215 seconds |
33
- ./spec/features/taxon_page_spec.rb[1:1:2] | passed | 0.3999 seconds |
34
- ./spec/features/taxon_page_spec.rb[1:1:3] | passed | 0.41779 seconds |
35
- ./spec/features/taxon_page_spec.rb[1:2:1] | passed | 0.40682 seconds |
36
- ./spec/features/taxon_page_spec.rb[1:2:2:1] | passed | 0.34453 seconds |
37
- ./spec/features/taxon_page_spec.rb[1:2:3:1] | passed | 0.39064 seconds |
38
- ./spec/features/taxon_page_spec.rb[1:3:1] | passed | 0.33643 seconds |
39
- ./spec/features/taxon_page_spec.rb[1:3:2] | passed | 0.43755 seconds |
40
- ./spec/features/taxon_page_spec.rb[1:4:1] | passed | 0.63277 seconds |
3
+ ./spec/features/add_to_cart_spec.rb[1:1:1] | passed | 0.66081 seconds |
4
+ ./spec/features/add_to_cart_spec.rb[1:2:1] | passed | 0.75237 seconds |
5
+ ./spec/features/add_to_cart_spec.rb[1:2:2] | passed | 0.67545 seconds |
6
+ ./spec/features/checkout_complete_spec.rb[1:1:1] | passed | 1.07 seconds |
7
+ ./spec/features/checkout_complete_spec.rb[1:2:1] | passed | 0.58496 seconds |
8
+ ./spec/features/checkout_complete_spec.rb[1:3:1] | passed | 0.47447 seconds |
9
+ ./spec/features/checkout_complete_spec.rb[1:4:1] | passed | 0.63761 seconds |
10
+ ./spec/features/checkout_initiated_spec.rb[1:1:1] | pending | 0.1245 seconds |
11
+ ./spec/features/checkout_initiated_spec.rb[1:2:1] | pending | 0.11937 seconds |
12
+ ./spec/features/checkout_initiated_spec.rb[1:3:1] | passed | 0.97884 seconds |
13
+ ./spec/features/checkout_initiated_spec.rb[1:4:1] | pending | 0.12569 seconds |
14
+ ./spec/features/homepage_spec.rb[1:1:1] | passed | 0.28455 seconds |
15
+ ./spec/features/homepage_spec.rb[1:1:2] | passed | 0.2939 seconds |
16
+ ./spec/features/homepage_spec.rb[1:2:1] | passed | 0.29915 seconds |
17
+ ./spec/features/homepage_spec.rb[1:2:2] | passed | 0.28221 seconds |
18
+ ./spec/features/homepage_spec.rb[1:3:1] | passed | 0.36746 seconds |
19
+ ./spec/features/homepage_spec.rb[1:3:2] | passed | 0.30991 seconds |
20
+ ./spec/features/homepage_spec.rb[1:4:1:1] | passed | 0.49752 seconds |
21
+ ./spec/features/product_page_spec.rb[1:1:1] | passed | 3.76 seconds |
22
+ ./spec/features/product_page_spec.rb[1:1:2] | passed | 0.46834 seconds |
23
+ ./spec/features/product_page_spec.rb[1:1:3] | passed | 0.43108 seconds |
24
+ ./spec/features/product_page_spec.rb[1:2:1] | passed | 0.43884 seconds |
25
+ ./spec/features/product_page_spec.rb[1:2:2:1] | passed | 0.37689 seconds |
26
+ ./spec/features/product_page_spec.rb[1:2:3:1] | passed | 0.40017 seconds |
27
+ ./spec/features/product_page_spec.rb[1:3:1] | passed | 0.34652 seconds |
28
+ ./spec/features/product_page_spec.rb[1:3:2] | passed | 0.42483 seconds |
29
+ ./spec/features/product_page_spec.rb[1:3:3] | passed | 0.38935 seconds |
30
+ ./spec/features/product_page_spec.rb[1:4:1:1] | passed | 0.58891 seconds |
31
+ ./spec/features/product_page_spec.rb[1:4:2:1] | passed | 0.92141 seconds |
32
+ ./spec/features/taxon_page_spec.rb[1:1:1] | passed | 0.45357 seconds |
33
+ ./spec/features/taxon_page_spec.rb[1:1:2] | passed | 0.37813 seconds |
34
+ ./spec/features/taxon_page_spec.rb[1:1:3] | passed | 0.4267 seconds |
35
+ ./spec/features/taxon_page_spec.rb[1:2:1] | passed | 0.43519 seconds |
36
+ ./spec/features/taxon_page_spec.rb[1:2:2:1] | passed | 0.41135 seconds |
37
+ ./spec/features/taxon_page_spec.rb[1:2:3:1] | passed | 0.42165 seconds |
38
+ ./spec/features/taxon_page_spec.rb[1:3:1] | passed | 0.41839 seconds |
39
+ ./spec/features/taxon_page_spec.rb[1:3:2] | passed | 0.39104 seconds |
40
+ ./spec/features/taxon_page_spec.rb[1:4:1] | passed | 0.66123 seconds |
@@ -2,16 +2,18 @@
2
2
 
3
3
  describe 'Add to cart', type: :system do
4
4
  let!(:store) { create(:store) }
5
- let!(:order) { create :completed_order_with_totals }
6
- let!(:line_item) { order.line_items.first }
5
+ let!(:product) { create(:product) }
6
+ let(:line_item_quantity) { 2 }
7
+ let(:order) { Spree::Order.last }
8
+ let(:line_item) { order.line_items.first }
7
9
 
8
10
  stub_authorization!
9
11
 
10
12
  before do
11
- current_order_stubs(order)
12
13
  stub_const 'ENV', ENV.to_h.merge(env_variable => 'XXX-YYYYY')
13
14
 
14
- visit spree.product_path(line_item.product)
15
+ visit spree.product_path(product)
16
+ fill_in('quantity', with: line_item_quantity)
15
17
  find('#add-to-cart-button').click
16
18
  end
17
19
 
@@ -20,7 +22,7 @@ describe 'Add to cart', type: :system do
20
22
 
21
23
  it 'tracks "add to cart" event with product data' do
22
24
  expect(page).to track_analytics_event :facebook, 'addtocart', [
23
- 'fbq', 'track', 'AddToCart', line_item.sku
25
+ 'fbq', 'track', 'AddToCart', line_item.amount, line_item.sku
24
26
  ]
25
27
  end
26
28
  end
@@ -30,8 +32,8 @@ describe 'Add to cart', type: :system do
30
32
 
31
33
  it 'tracks "add to cart" event' do
32
34
  expect(page).to track_analytics_event :pinterest, 'addtocart', [
33
- 'track', 'addtocart', order.total, order.number, line_item.variant.product.master.sku,
34
- line_item.name, line_item.variant.sku, line_item.variant.price
35
+ 'track', 'addtocart', line_item.amount, order.number, line_item.product.sku,
36
+ line_item.name, line_item.sku, line_item.price
35
37
  ]
36
38
  end
37
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_seo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karma Creative
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-28 00:00:00.000000000 Z
11
+ date: 2021-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core