Sha256: ebb07e5af1eeed27eb8311501d2389b8af24ea25c4431d0903741912f136ff02

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

require 'helper'
require 'mws/fulfillment_inbound_shipment'

class TestFulfillmentInboundShipment < IntegrationTest
  Address = Struct.new(:name, :address_line_1, :city, :state_or_province_code,
                       :postal_code, :country_code)
  Item = Struct.new(:seller_sku, :quantity)

  def test_creates_inbound_shipment_plan
    address = Address.new('John', '1 Main St', 'New York', 'NY', '10001', 'US')
    item = Item.new('123', 1)
    clients.each do |client|
      res = client.create_inbound_shipment_plan(address, [item])
      refute_empty res.parse
    end
  end

  def test_gets_service_status
    clients.each do |client|
      res = client.get_service_status
      refute_empty res.parse
    end
  end

  def test_handles_large_requests
    address = Address.new('John', '1 Main St', 'New York', 'NY', '10001', 'US')
    items = 100.times.map { |count| Item.new(count, 1) }
    clients.each do |client|
      res = client.create_inbound_shipment_plan(address, items)
      assert_equal 200, res.status
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
peddler-1.2.0 test/integration/test_fulfillment_inbound_shipment.rb
peddler-1.1.1 test/integration/test_fulfillment_inbound_shipment.rb
peddler-1.1.0 test/integration/test_fulfillment_inbound_shipment.rb
peddler-1.0.2 test/integration/test_fulfillment_inbound_shipment.rb
peddler-1.0.1 test/integration/test_fulfillment_inbound_shipment.rb
peddler-1.0.0 test/integration/test_fulfillment_inbound_shipment.rb
peddler-0.19.0 test/integration/test_fulfillment_inbound_shipment.rb
peddler-0.18.0 test/integration/test_fulfillment_inbound_shipment.rb
peddler-0.17.1 test/integration/test_fulfillment_inbound_shipment.rb
peddler-0.17.0 test/integration/test_fulfillment_inbound_shipment.rb
peddler-0.16.0 test/integration/test_fulfillment_inbound_shipment.rb