Sha256: 0a1700f12acd94bb92dd94b9d0dc804697eaec1aeb3a07722307145e86a24090

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.2 test/integration/test_mws_orders.rb