Sha256: e30e2c0684fbfdda343215e8d9231e87e9edf63f5df96555ab821b4ceb27ed7a

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 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
  end

  def test_lists_orders_and_their_items
    orders = @client.list_orders(created_after: one_year_ago)
    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)
    order_items = @client.list_order_items(amazon_order_id)
    refute_empty order_items
  end

  private

  def one_year_ago
    Date.today - 365
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mws-orders-0.2.0 test/integration/test_mws_orders.rb
mws-orders-0.1.1 test/integration/test_mws_orders.rb