Sha256: c4a6f097757f2535c94d8d151c0c60811774cae4fd89988ad16ff414c0774c2e

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class ShipStationIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest

      def test_setting_order_on_hold
        order = create_placed_order

        hold_date = 10.days.from_now
        patch admin.save_hold_date_order_path(order),
          params: {
            hold_until: hold_date
          }

        order.reload

        assert(order.ship_station_on_hold?)
        assert(order.ship_station_on_hold_until.present?)
      end

      def test_setting_order_on_hold_error
        order = create_placed_order

        hold_date = "xxxxx"
        patch admin.save_hold_date_order_path(order),
          params: {
            hold_until: hold_date
          }

        order.reload

        refute(order.ship_station_on_hold?)
        refute(order.ship_station_on_hold_until.present?)
      end


      def test_clearing_order_hold
        order = create_placed_order(ship_station_on_hold_until: 1.day.from_now)

        assert(order.ship_station_on_hold?)

        patch admin.clear_hold_date_order_path(order)
        order.reload

        refute(order.ship_station_on_hold?)
        refute(order.ship_station_on_hold_until.present?)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-ship_station-1.0.1 test/integration/workarea/admin/ship_station_integration_test.rb