spree_frontend 3.3.0.rc1 → 3.3.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/frontend.js +0 -1
  3. data/app/assets/javascripts/spree/frontend/checkout/address.js.coffee +0 -2
  4. data/app/assets/stylesheets/spree/frontend/frontend_bootstrap.css.scss +1 -1
  5. data/app/controllers/spree/orders_controller.rb +17 -15
  6. data/app/helpers/spree/frontend_helper.rb +0 -5
  7. data/app/helpers/spree/store_helper.rb +5 -0
  8. data/app/views/spree/address/_form.html.erb +12 -10
  9. data/app/views/spree/checkout/edit.html.erb +1 -5
  10. data/app/views/spree/products/_product.html.erb +22 -0
  11. data/app/views/spree/shared/_header.html.erb +1 -1
  12. data/app/views/spree/shared/_order_details.html.erb +1 -3
  13. data/app/views/spree/{payments → shared}/_payment.html.erb +2 -0
  14. data/app/views/spree/shared/_products.html.erb +1 -25
  15. data/app/views/spree/shared/_search.html.erb +1 -2
  16. data/config/routes.rb +4 -0
  17. data/lib/spree/frontend/engine.rb +0 -1
  18. data/spree_frontend.gemspec +1 -2
  19. metadata +10 -139
  20. data/app/views/spree/store/cart_link.html.erb +0 -1
  21. data/config/initializers/spree.rb +0 -2
  22. data/lib/tasks/rake_util.rb +0 -19
  23. data/lib/tasks/taxon.rake +0 -14
  24. data/spec/controllers/controller_extension_spec.rb +0 -126
  25. data/spec/controllers/controller_helpers_spec.rb +0 -122
  26. data/spec/controllers/spree/checkout_controller_spec.rb +0 -547
  27. data/spec/controllers/spree/checkout_controller_with_views_spec.rb +0 -36
  28. data/spec/controllers/spree/content_controller_spec.rb +0 -12
  29. data/spec/controllers/spree/current_order_tracking_spec.rb +0 -44
  30. data/spec/controllers/spree/home_controller_spec.rb +0 -47
  31. data/spec/controllers/spree/orders_controller_ability_spec.rb +0 -96
  32. data/spec/controllers/spree/orders_controller_spec.rb +0 -134
  33. data/spec/controllers/spree/orders_controller_transitions_spec.rb +0 -31
  34. data/spec/controllers/spree/products_controller_spec.rb +0 -87
  35. data/spec/controllers/spree/taxons_controller_spec.rb +0 -12
  36. data/spec/features/address_spec.rb +0 -93
  37. data/spec/features/automatic_promotion_adjustments_spec.rb +0 -47
  38. data/spec/features/caching/products_spec.rb +0 -59
  39. data/spec/features/caching/taxons_spec.rb +0 -22
  40. data/spec/features/cart_spec.rb +0 -132
  41. data/spec/features/checkout_spec.rb +0 -723
  42. data/spec/features/checkout_unshippable_spec.rb +0 -34
  43. data/spec/features/coupon_code_spec.rb +0 -88
  44. data/spec/features/currency_spec.rb +0 -18
  45. data/spec/features/delivery_spec.rb +0 -64
  46. data/spec/features/free_shipping_promotions_spec.rb +0 -59
  47. data/spec/features/locale_spec.rb +0 -60
  48. data/spec/features/microdata_spec.rb +0 -0
  49. data/spec/features/order_spec.rb +0 -107
  50. data/spec/features/page_promotions_spec.rb +0 -36
  51. data/spec/features/products_spec.rb +0 -345
  52. data/spec/features/taxons_spec.rb +0 -147
  53. data/spec/features/template_rendering_spec.rb +0 -19
  54. data/spec/fixtures/thinking-cat.jpg +0 -0
  55. data/spec/helpers/frontend_helper_spec.rb +0 -57
  56. data/spec/helpers/taxons_helper_spec.rb +0 -17
  57. data/spec/spec_helper.rb +0 -128
  58. data/spec/support/shared_contexts/checkout_setup.rb +0 -10
  59. data/spec/support/shared_contexts/custom_products.rb +0 -25
  60. data/spec/support/shared_contexts/product_prototypes.rb +0 -30
  61. data/spec/views/spree/checkout/_summary_spec.rb +0 -11
  62. data/vendor/assets/javascripts/jquery.validate/additional-methods.min.js +0 -12
  63. data/vendor/assets/javascripts/jquery.validate/jquery.validate.min.js +0 -12
  64. data/vendor/assets/javascripts/jquery.validate/localization/messages_ar.js +0 -25
  65. data/vendor/assets/javascripts/jquery.validate/localization/messages_bg.js +0 -25
  66. data/vendor/assets/javascripts/jquery.validate/localization/messages_ca.js +0 -25
  67. data/vendor/assets/javascripts/jquery.validate/localization/messages_cs.js +0 -25
  68. data/vendor/assets/javascripts/jquery.validate/localization/messages_da.js +0 -22
  69. data/vendor/assets/javascripts/jquery.validate/localization/messages_de.js +0 -22
  70. data/vendor/assets/javascripts/jquery.validate/localization/messages_el.js +0 -25
  71. data/vendor/assets/javascripts/jquery.validate/localization/messages_es.js +0 -25
  72. data/vendor/assets/javascripts/jquery.validate/localization/messages_et.js +0 -23
  73. data/vendor/assets/javascripts/jquery.validate/localization/messages_eu.js +0 -25
  74. data/vendor/assets/javascripts/jquery.validate/localization/messages_fa.js +0 -25
  75. data/vendor/assets/javascripts/jquery.validate/localization/messages_fi.js +0 -23
  76. data/vendor/assets/javascripts/jquery.validate/localization/messages_fr.js +0 -47
  77. data/vendor/assets/javascripts/jquery.validate/localization/messages_ge.js +0 -23
  78. data/vendor/assets/javascripts/jquery.validate/localization/messages_he.js +0 -25
  79. data/vendor/assets/javascripts/jquery.validate/localization/messages_hr.js +0 -25
  80. data/vendor/assets/javascripts/jquery.validate/localization/messages_hu.js +0 -24
  81. data/vendor/assets/javascripts/jquery.validate/localization/messages_it.js +0 -25
  82. data/vendor/assets/javascripts/jquery.validate/localization/messages_ja.js +0 -25
  83. data/vendor/assets/javascripts/jquery.validate/localization/messages_ka.js +0 -25
  84. data/vendor/assets/javascripts/jquery.validate/localization/messages_kk.js +0 -25
  85. data/vendor/assets/javascripts/jquery.validate/localization/messages_ko.js +0 -25
  86. data/vendor/assets/javascripts/jquery.validate/localization/messages_lt.js +0 -25
  87. data/vendor/assets/javascripts/jquery.validate/localization/messages_lv.js +0 -25
  88. data/vendor/assets/javascripts/jquery.validate/localization/messages_ms.js +0 -25
  89. data/vendor/assets/javascripts/jquery.validate/localization/messages_nl.js +0 -35
  90. data/vendor/assets/javascripts/jquery.validate/localization/messages_no.js +0 -25
  91. data/vendor/assets/javascripts/jquery.validate/localization/messages_pl.js +0 -25
  92. data/vendor/assets/javascripts/jquery.validate/localization/messages_ptbr.js +0 -24
  93. data/vendor/assets/javascripts/jquery.validate/localization/messages_ptpt.js +0 -24
  94. data/vendor/assets/javascripts/jquery.validate/localization/messages_ro.js +0 -25
  95. data/vendor/assets/javascripts/jquery.validate/localization/messages_ru.js +0 -25
  96. data/vendor/assets/javascripts/jquery.validate/localization/messages_se.js +0 -23
  97. data/vendor/assets/javascripts/jquery.validate/localization/messages_si.js +0 -25
  98. data/vendor/assets/javascripts/jquery.validate/localization/messages_sk.js +0 -22
  99. data/vendor/assets/javascripts/jquery.validate/localization/messages_sl.js +0 -25
  100. data/vendor/assets/javascripts/jquery.validate/localization/messages_sr.js +0 -25
  101. data/vendor/assets/javascripts/jquery.validate/localization/messages_sv.js +0 -23
  102. data/vendor/assets/javascripts/jquery.validate/localization/messages_th.js +0 -25
  103. data/vendor/assets/javascripts/jquery.validate/localization/messages_tr.js +0 -25
  104. data/vendor/assets/javascripts/jquery.validate/localization/messages_tw.js +0 -24
  105. data/vendor/assets/javascripts/jquery.validate/localization/messages_uk.js +0 -25
  106. data/vendor/assets/javascripts/jquery.validate/localization/messages_vi.js +0 -25
  107. data/vendor/assets/javascripts/jquery.validate/localization/messages_zh.js +0 -25
  108. data/vendor/assets/javascripts/jquery.validate/localization/messages_zhtw.js +0 -26
  109. data/vendor/assets/javascripts/jquery.validate/localization/methods_de.js +0 -12
  110. data/vendor/assets/javascripts/jquery.validate/localization/methods_nl.js +0 -9
  111. data/vendor/assets/javascripts/jquery.validate/localization/methods_pt.js +0 -9
@@ -1,34 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "checkout with unshippable items", type: :feature, inaccessible: true do
4
- let!(:stock_location) { create(:stock_location) }
5
- let(:order) { OrderWalkthrough.up_to(:delivery) }
6
-
7
- before do
8
- OrderWalkthrough.add_line_item!(order)
9
- line_item = order.line_items.last
10
- stock_item = stock_location.stock_item(line_item.variant)
11
- stock_item.adjust_count_on_hand -999
12
- stock_item.backorderable = false
13
- stock_item.save!
14
-
15
- user = create(:user)
16
- order.user = user
17
- order.update_with_updater!
18
-
19
- allow_any_instance_of(Spree::CheckoutController).to receive_messages(current_order: order)
20
- allow_any_instance_of(Spree::CheckoutController).to receive_messages(try_spree_current_user: user)
21
- allow_any_instance_of(Spree::CheckoutController).to receive_messages(skip_state_validation?: true)
22
- allow_any_instance_of(Spree::CheckoutController).to receive_messages(ensure_sufficient_stock_lines: true)
23
- end
24
-
25
- it 'displays and removes' do
26
- visit spree.checkout_state_path(:delivery)
27
- expect(page).to have_content('Unshippable Items')
28
-
29
- click_button "Save and Continue"
30
-
31
- order.reload
32
- expect(order.line_items.count).to eq 1
33
- end
34
- end
@@ -1,88 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Coupon code promotions", type: :feature, js: true do
4
- let!(:country) { create(:country, name: "United States of America", states_required: true) }
5
- let!(:state) { create(:state, name: "Alabama", country: country) }
6
- let!(:zone) { create(:zone) }
7
- let!(:shipping_method) { create(:shipping_method) }
8
- let!(:payment_method) { create(:check_payment_method) }
9
- let!(:product) { create(:product, name: "RoR Mug", price: 20) }
10
- let!(:store) { create(:store) }
11
-
12
- context "visitor makes checkout as guest without registration" do
13
- def create_basic_coupon_promotion(code)
14
- promotion = Spree::Promotion.create!(name: code.titleize,
15
- code: code,
16
- starts_at: 1.day.ago,
17
- expires_at: 1.day.from_now)
18
-
19
- calculator = Spree::Calculator::FlatRate.new
20
- calculator.preferred_amount = 10
21
-
22
- action = Spree::Promotion::Actions::CreateItemAdjustments.new
23
- action.calculator = calculator
24
- action.promotion = promotion
25
- action.save
26
-
27
- promotion.reload # so that promotion.actions is available
28
- end
29
-
30
- let!(:promotion) { create_basic_coupon_promotion("onetwo") }
31
-
32
- # OrdersController
33
- context "on the payment page" do
34
- before do
35
- visit spree.root_path
36
- click_link "RoR Mug"
37
- click_button "add-to-cart-button"
38
- click_button "Checkout"
39
- fill_in "order_email", with: "spree@example.com"
40
- fill_in "First Name", with: "John"
41
- fill_in "Last Name", with: "Smith"
42
- fill_in "Street Address", with: "1 John Street"
43
- fill_in "City", with: "City of John"
44
- fill_in "Zip", with: "01337"
45
- select country.name, from: "Country"
46
- select state.name, from: "order[bill_address_attributes][state_id]"
47
- fill_in "Phone", with: "555-555-5555"
48
-
49
- # To shipping method screen
50
- click_button "Save and Continue"
51
- # To payment screen
52
- click_button "Save and Continue"
53
- end
54
-
55
- it "informs about an invalid coupon code" do
56
- fill_in "order_coupon_code", with: "coupon_codes_rule_man"
57
- click_button "Save and Continue"
58
- expect(page).to have_content(Spree.t(:coupon_code_not_found))
59
- end
60
-
61
- it "informs the user about a coupon code which has exceeded its usage" do
62
- promotion.update_column(:usage_limit, 5)
63
- allow_any_instance_of(promotion.class).to receive_messages(credits_count: 10)
64
-
65
- fill_in "order_coupon_code", with: "onetwo"
66
- click_button "Save and Continue"
67
- expect(page).to have_content(Spree.t(:coupon_code_max_usage))
68
- end
69
-
70
- it "can enter an invalid coupon code, then a real one" do
71
- fill_in "order_coupon_code", with: "coupon_codes_rule_man"
72
- click_button "Save and Continue"
73
- expect(page).to have_content(Spree.t(:coupon_code_not_found))
74
- fill_in "order_coupon_code", with: "onetwo"
75
- click_button "Save and Continue"
76
- expect(page).to have_content("Promotion (Onetwo) -$10.00")
77
- end
78
-
79
- context "with a promotion" do
80
- it "applies a promotion to an order" do
81
- fill_in "order_coupon_code", with: "onetwo"
82
- click_button "Save and Continue"
83
- expect(page).to have_content("Promotion (Onetwo) -$10.00")
84
- end
85
- end
86
- end
87
- end
88
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Switching currencies in backend", type: :feature do
4
- before do
5
- create(:base_product, name: "RoR Mug")
6
- end
7
-
8
- # Regression test for #2340
9
- it "does not cause current_order to become nil", inaccessible: true do
10
- visit spree.root_path
11
- click_link "RoR Mug"
12
- click_button "Add To Cart"
13
- # Now that we have an order...
14
- Spree::Config[:currency] = "AUD"
15
- expect { visit spree.root_path }.not_to raise_error
16
- end
17
-
18
- end
@@ -1,64 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Delivery', type: :feature, inaccessible: true, js: true do
4
- include_context 'checkout setup'
5
-
6
- let(:country) { create(:country, name: 'United States of America', iso_name: 'UNITED STATES') }
7
- let(:state) { create(:state, name: 'Alabama', abbr: 'AL', country: country) }
8
- let!(:product2) { create(:product) }
9
- let(:user) { create(:user) }
10
- let!(:shipping_method2) do
11
- sm = create(:shipping_method, name: 'Shipping Method2')
12
- sm.calculator.preferred_amount = 20
13
- sm.calculator.save
14
- sm
15
- end
16
-
17
- before do
18
- shipping_method.calculator.preferred_amount = 10
19
- shipping_method.calculator.save
20
- end
21
-
22
- describe 'shipping total gets updated when shipping method is changed in the delivery step' do
23
- before do
24
- add_mug_to_cart
25
- click_button 'Checkout'
26
-
27
- fill_in 'order_email', with: 'test@example.com'
28
- click_on 'Continue'
29
- fill_in_address
30
-
31
- click_button 'Save and Continue'
32
- end
33
-
34
- it 'should contain the shipping total' do
35
- expect(page).to have_content('Shipping total: $10.00')
36
- end
37
-
38
- context 'shipping method is changed' do
39
- before { choose(shipping_method2.name) }
40
-
41
- it 'shipping total and order total both are updates' do
42
- expect(page).to have_content("Shipping total: $20.00")
43
- end
44
- end
45
- end
46
-
47
- def fill_in_address
48
- address = "order_bill_address_attributes"
49
- fill_in "#{address}_firstname", with: FFaker::Name.first_name
50
- fill_in "#{address}_lastname", with: FFaker::Name.last_name
51
- fill_in "#{address}_address1", with: FFaker::Address.street_address
52
- fill_in "#{address}_city", with: FFaker::Address.city
53
- select country.name, from: "#{address}_country_id"
54
- select state.name, from: "#{address}_state_id"
55
- fill_in "#{address}_zipcode", with: FFaker::AddressUS.zip_code
56
- fill_in "#{address}_phone", with: FFaker::PhoneNumber.phone_number
57
- end
58
-
59
- def add_mug_to_cart
60
- visit spree.root_path
61
- click_link mug.name
62
- click_button "add-to-cart-button"
63
- end
64
- end
@@ -1,59 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Free shipping promotions", type: :feature, js: true do
4
- let!(:country) { create(:country, name: "United States of America", states_required: true) }
5
- let!(:state) { create(:state, name: "Alabama", country: country) }
6
- let!(:zone) { create(:zone) }
7
- let!(:shipping_method) do
8
- sm = create(:shipping_method)
9
- sm.calculator.preferred_amount = 10
10
- sm.calculator.save
11
- sm
12
- end
13
-
14
- let!(:payment_method) { create(:check_payment_method) }
15
- let!(:product) { create(:product, name: "RoR Mug", price: 20) }
16
- let!(:promotion) do
17
- promotion = Spree::Promotion.create!(name: "Free Shipping",
18
- starts_at: 1.day.ago,
19
- expires_at: 1.day.from_now)
20
-
21
- action = Spree::Promotion::Actions::FreeShipping.new
22
- action.promotion = promotion
23
- action.save
24
-
25
- promotion.reload # so that promotion.actions is available
26
- end
27
-
28
- context "free shipping promotion automatically applied" do
29
- before do
30
-
31
- visit spree.root_path
32
- click_link "RoR Mug"
33
- click_button "add-to-cart-button"
34
- click_button "Checkout"
35
- fill_in "order_email", with: "spree@example.com"
36
- fill_in "First Name", with: "John"
37
- fill_in "Last Name", with: "Smith"
38
- fill_in "Street Address", with: "1 John Street"
39
- fill_in "City", with: "City of John"
40
- fill_in "Zip", with: "01337"
41
- select country.name, from: "Country"
42
- select state.name, from: "order[bill_address_attributes][state_id]"
43
- fill_in "Phone", with: "555-555-5555"
44
-
45
- # To shipping method screen
46
- click_button "Save and Continue"
47
- # To payment screen
48
- click_button "Save and Continue"
49
- end
50
-
51
- # Regression test for #4428
52
- it "applies the free shipping promotion" do
53
- within("#checkout-summary") do
54
- expect(page).to have_content("Shipping total: $10.00")
55
- expect(page).to have_content("Promotion (Free Shipping): -$10.00")
56
- end
57
- end
58
- end
59
- end
@@ -1,60 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'setting locale', type: :feature do
4
- def with_locale(locale)
5
- I18n.locale = locale
6
- Spree::Frontend::Config[:locale] = locale
7
- yield
8
- I18n.locale = 'en'
9
- Spree::Frontend::Config[:locale] = 'en'
10
- end
11
-
12
- context 'shopping cart link and page' do
13
- before do
14
- I18n.backend.store_translations(:fr,
15
- spree: {
16
- cart: 'Panier',
17
- shopping_cart: 'Panier'
18
- })
19
- end
20
-
21
- it 'should be in french' do
22
- with_locale('fr') do
23
- visit spree.root_path
24
- click_link 'Panier'
25
- expect(page).to have_content('Panier')
26
- end
27
- end
28
- end
29
-
30
- context 'checkout form validation messages' do
31
- include_context 'checkout setup'
32
-
33
- let(:error_messages) do
34
- {
35
- 'en' => 'This field is required.',
36
- 'fr' => 'Ce champ est obligatoire.',
37
- 'de' => 'Dieses Feld ist ein Pflichtfeld.',
38
- }
39
- end
40
-
41
- def check_error_text(text)
42
- %w(firstname lastname address1 city).each do |attr|
43
- expect(find("#b#{attr} label.error").text).to eq(text)
44
- end
45
- end
46
-
47
- it 'shows translated jquery.validate error messages', js: true do
48
- visit spree.root_path
49
- click_link mug.name
50
- click_button 'add-to-cart-button'
51
- error_messages.each do |locale, message|
52
- with_locale(locale) do
53
- visit '/checkout/address'
54
- find('.form-buttons input[type=submit]').click
55
- check_error_text message
56
- end
57
- end
58
- end
59
- end
60
- end
File without changes
@@ -1,107 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'orders', type: :feature do
4
- let(:order) { OrderWalkthrough.up_to(:complete) }
5
- let(:user) { create(:user) }
6
-
7
- before do
8
- order.update_attribute(:user_id, user.id)
9
- order.shipments.destroy_all
10
- allow_any_instance_of(Spree::OrdersController).to receive_messages(try_spree_current_user: user)
11
- end
12
-
13
- it "can visit an order" do
14
- # Regression test for current_user call on orders/show
15
- expect { visit spree.order_path(order) }.not_to raise_error
16
- end
17
-
18
- it "should display line item price" do
19
- # Regression test for #2772
20
- line_item = order.line_items.first
21
- line_item.target_shipment = create(:shipment)
22
- line_item.price = 19.00
23
- line_item.save!
24
-
25
- visit spree.order_path(order)
26
-
27
- # Tests view spree/shared/_order_details
28
- within 'td.price' do
29
- expect(page).to have_content "19.00"
30
- end
31
- end
32
-
33
- it "should have credit card info if paid with credit card" do
34
- create(:payment, order: order)
35
- visit spree.order_path(order)
36
- within '.payment-info' do
37
- expect(page).to have_content "Ending in 1111"
38
- end
39
- end
40
-
41
- it "should have payment method name visible if not paid with credit card" do
42
- create(:check_payment, order: order)
43
- visit spree.order_path(order)
44
- within '.payment-info' do
45
- expect(page).to have_content "Check"
46
- end
47
- end
48
-
49
- # Regression test for #2282
50
- context "can support a credit card with blank information" do
51
- before do
52
- credit_card = create(:credit_card)
53
- credit_card.update_column(:cc_type, '')
54
- payment = order.payments.first
55
- payment.source = credit_card
56
- payment.save!
57
- end
58
-
59
- specify do
60
- visit spree.order_path(order)
61
- within '.payment-info' do
62
- expect { find("img") }.to raise_error(Capybara::ElementNotFound)
63
- end
64
- end
65
- end
66
-
67
- it "should return the correct title when displaying a completed order" do
68
- visit spree.order_path(order)
69
-
70
- within '#order_summary' do
71
- expect(page).to have_content("#{Spree.t(:order)} #{order.number}")
72
- end
73
- end
74
-
75
- # Regression test for #6733
76
- context "address_requires_state preference" do
77
- context "when set to true" do
78
- before do
79
- configure_spree_preferences { |config| config.address_requires_state = true }
80
- end
81
-
82
- it "should show state text" do
83
- visit spree.order_path(order)
84
-
85
- within '#order' do
86
- expect(page).to have_content(order.bill_address.state_text)
87
- expect(page).to have_content(order.ship_address.state_text)
88
- end
89
- end
90
- end
91
-
92
- context "when set to false" do
93
- before do
94
- configure_spree_preferences { |config| config.address_requires_state = false }
95
- end
96
-
97
- it "should not show state text" do
98
- visit spree.order_path(order)
99
-
100
- within '#order' do
101
- expect(page).not_to have_content(order.bill_address.state_text)
102
- expect(page).not_to have_content(order.ship_address.state_text)
103
- end
104
- end
105
- end
106
- end
107
- end
@@ -1,36 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'page promotions', type: :feature do
4
- let!(:product) { create(:product, name: "RoR Mug", price: 20) }
5
- before do
6
- promotion = Spree::Promotion.create!(name: "$10 off",
7
- path: 'test',
8
- starts_at: 1.day.ago,
9
- expires_at: 1.day.from_now)
10
-
11
- calculator = Spree::Calculator::FlatRate.new
12
- calculator.preferred_amount = 10
13
-
14
- action = Spree::Promotion::Actions::CreateItemAdjustments.create(calculator: calculator)
15
- promotion.actions << action
16
-
17
- visit spree.root_path
18
- click_link "RoR Mug"
19
- click_button "add-to-cart-button"
20
- end
21
-
22
- it "automatically applies a page promotion upon visiting" do
23
- expect(page).not_to have_content("Promotion ($10 off) -$10.00")
24
- visit '/content/test'
25
- visit '/cart'
26
- expect(page).to have_content("Promotion ($10 off) -$10.00")
27
- expect(page).to have_content("Subtotal (1 item) $20.00")
28
- end
29
-
30
- it "does not activate an adjustment for a path that doesn't have a promotion" do
31
- expect(page).not_to have_content("Promotion ($10 off) -$10.00")
32
- visit '/content/cvv'
33
- visit '/cart'
34
- expect(page).not_to have_content("Promotion ($10 off) -$10.00")
35
- end
36
- end