Sha256: f9753c46cf87d3cc13a419a52cf7cb369688830b4b26bbb73d066c9b1a1be441

Contents?: true

Size: 1.55 KB

Versions: 34

Compression:

Stored size: 1.55 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class PricingOverridesSystemTest < SystemTest
      include Admin::IntegrationTest
      include Storefront::SystemTest

      setup :setup_checkout_specs, :add_product_to_cart

      def test_overriding_order_pricing
        visit storefront.cart_path

        wait_for_xhr
        within_frame find('.admin-toolbar') do
          click_link t('workarea.admin.toolbar.adjust_order_pricing')
        end

        order = Order.not_placed.last

        assert_current_path(admin.edit_pricing_override_path(order.id))
        fill_in "override[item_prices][#{order.items.first.id}]", with: '1.50'
        click_button 'adjust_order_pricing'

        assert_current_path(storefront.cart_path)
        assert(page.has_content?(t('workarea.pricing_overrides.description')))
        assert(page.has_content?('-$7.00')) # pricing override amount
        assert(page.has_content?('$3.00')) # total
        click_link t('workarea.storefront.carts.checkout'), match: :first

        fill_in_shipping_address
        click_button t('workarea.storefront.checkouts.continue_to_shipping')

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

        fill_in_credit_card
        click_button t('workarea.storefront.checkouts.place_order')
        assert_current_path(admin.order_path(Order.placed.desc(:placed_at).first))
        assert(page.has_content?('Success'))
        assert(page.has_content?('$10.70')) # total w/ shipping
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-storefront-3.4.45 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.44 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.43 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.42 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.41 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.40 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.39 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.38 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.37 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.36 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.35 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.34 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.33 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.32 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.31 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.30 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.29 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.28 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.27 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.26 test/system/workarea/storefront/pricing_overrides_system_test.rb