Sha256: ffe47d460c540845164d1677e7cd4d085806f2cf8e92ca1f5494806afdc1ccb7

Contents?: true

Size: 1.02 KB

Versions: 13

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'

class RemoteKunakiTest < Minitest::Test
  include ActiveShipping::Test::Fixtures

  def setup
    @carrier = Kunaki.new
    @item1 = { :sku => 'XZZ1111111', :quantity => 2 }
    @item2 = { :sku => 'PXZZ111112', :quantity => 1 }
    @items = [@item1, @item2]
  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 3, response.rates.size
    assert_equal ["UPS 2nd Day Air", "UPS Ground", "UPS Next Day Air Saver"], 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

13 entries across 13 versions & 1 rubygems

Version Path
active_shipping-1.8.1 test/remote/kunaki_test.rb
active_shipping-1.8.0 test/remote/kunaki_test.rb
active_shipping-1.7.3 test/remote/kunaki_test.rb
active_shipping-1.7.2 test/remote/kunaki_test.rb
active_shipping-1.7.1 test/remote/kunaki_test.rb
active_shipping-1.7.0 test/remote/kunaki_test.rb
active_shipping-1.6.5 test/remote/kunaki_test.rb
active_shipping-1.6.4 test/remote/kunaki_test.rb
active_shipping-1.6.3 test/remote/kunaki_test.rb
active_shipping-1.6.2 test/remote/kunaki_test.rb
active_shipping-1.6.1 test/remote/kunaki_test.rb
active_shipping-1.6.0 test/remote/kunaki_test.rb
active_shipping-1.5.0 test/remote/kunaki_test.rb