Sha256: fdeb05bc20bc89b9e392f80e9ecf29a09683006883d9f9840f999c235eae0d6f

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

require "test_helper"

class TestMWSOrders < MiniTest::Test
  def setup
    skip unless ENV['AWS_ACCESS_KEY_ID']
    @client = MWS.orders
  end

  def test_gets_service_status
    assert_kind_of ServiceStatus, @client.get_service_status.parse
  end

  def test_lists_orders_and_their_items
    orders = @client.list_orders(created_after: one_year_ago).parse
    refute_empty orders
    amazon_order_id = orders.to_a.sample.amazon_order_id
    assert_kind_of MWS::Orders::Order, @client.get_order(amazon_order_id).parse
    order_items = @client.list_order_items(amazon_order_id).parse
    refute_empty order_items
  end

  private

  def one_year_ago
    Date.today - 365
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mws-orders-0.2.1 test/integration/test_mws_orders.rb