Sha256: 270da656c136dd8ab71d9c50336aa908bfd36d56445e7889f0158c8f60491980

Contents?: true

Size: 1.08 KB

Versions: 62

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

class RemoteKunakiTest < ActiveSupport::TestCase
  include ActiveShipping::Test::Fixtures

  def setup
    @carrier = Kunaki.new
    @item1 = { sku: 'PX002LTGLS', quantity: 2 }
    @item2 = { sku: 'PX00MXGKAR', quantity: 1 }
    @item3 = { sku: 'PX00ZEDG6F', quantity: 1 }
    @items = [@item1, @item2, @item3]
  end

  def test_successful_rates_request
    response = @carrier.find_rates(
      location_fixtures[:ottawa],
                 location_fixtures[:beverly_hills],
                 package_fixtures.values_at(:book, :wii),
                 items: @items
               )

    assert response.success?
    assert_equal 4, response.rates.size
    assert_equal ["UPS 2nd Day Air", "UPS Ground", "UPS Next Day Air Saver", "USPS First Class Mail"], response.rates.collect(&:service_name).sort
  end

  def test_send_no_items
    assert_raises(ActiveUtils::ResponseError) do
      @carrier.find_rates(
        location_fixtures[:ottawa],
        location_fixtures[:beverly_hills],
        package_fixtures.values_at(:book, :wii),
        items: []
      )
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.26 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.45 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.25 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.23 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.44 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.22 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.43 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.21 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.42 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.20 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.41 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.19 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.40 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.18 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.39 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.17 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.38 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.5.16 vendor/active_shipping/test/remote/kunaki_test.rb
workarea-core-3.4.37 vendor/active_shipping/test/remote/kunaki_test.rb