Sha256: 12257c730ae465a06d7ebb73a48c87304e329aebdfdbf390449dd678fb23c9ea

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

module Workarea
  decorate Storefront::LoggedInCheckoutSystemTest, with: :one_theme do
    def test_checking_out_with_discount
      visit storefront.checkout_addresses_path
      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/logged_in_checkout_system_test.decorator
workarea-one_theme-1.3.0 test/system/workarea/storefront/logged_in_checkout_system_test.decorator