Sha256: 0a4783a2544f01f4a9cefcea4acd76d5d245419d40871e7567474643ed955866

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 KB

Contents

require 'test_helper'

module Workarea
  decorate Storefront::GuestCheckoutSystemTest, with: :one_theme do
    def test_checking_out_with_a_discount
      visit storefront.checkout_addresses_path
      fill_in_email
      fill_in_shipping_address
      uncheck 'same_as_shipping'
      fill_in_billing_address
      click_button t('workarea.storefront.checkouts.continue_to_shipping')

      assert_current_path(storefront.checkout_shipping_path)
      click_button t('workarea.storefront.checkouts.continue_to_payment')

      assert_current_path(storefront.checkout_payment_path)
      create_order_total_discount(
        name: 'Testing Discount',
        amount_type: 'flat',
        amount: 1,
        promo_codes: ['PROMOCODE']
      )

      page.find('.promo-code-accordion__heading').click
      fill_in 'promo_code', with: 'PROMOCODE'
      click_button t('workarea.storefront.carts.add')

      assert(page.has_content?('Success'))
      assert(page.has_content?('Testing Discount'))
      assert(page.has_content?('$5.00'))  # Subtotal
      assert(page.has_content?('$7.00'))  # Shipping
      assert(page.has_content?('$0.77'))  # Tax
      assert(page.has_content?('$1.00'))  # Discount
      assert(page.has_content?('$11.77')) # Total
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-one_theme-1.3.1 test/system/workarea/storefront/guest_checkout_system_test.decorator
workarea-one_theme-1.3.0 test/system/workarea/storefront/guest_checkout_system_test.decorator