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.25 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.24 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.23 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.22 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.21 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.20 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.19 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.18 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.17 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.16 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.15 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.14 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.13 test/system/workarea/storefront/pricing_overrides_system_test.rb
workarea-storefront-3.4.12 test/system/workarea/storefront/pricing_overrides_system_test.rb