Sha256: c7609c5779f48d26a3b9b20b3c8fd196b806231777ccd096c6f05081d528588f

Contents?: true

Size: 806 Bytes

Versions: 2

Compression:

Stored size: 806 Bytes

Contents

# frozen_string_literal: true

require 'integration_helper'
require 'mws/orders'

class TestOrders < IntegrationTest
  def test_getting_orders
    clients.each do |client|
      order_ids = client.list_orders(client.marketplace.id,
                                     created_after: Date.new(2015),
                                     max_results_per_page: 5)
                        .dig('Orders', 'Order')
                        .map { |order| order['AmazonOrderId'] }

      next if order_ids.count < 2

      res = client.get_order(*order_ids)
      orders = res.dig('Orders', 'Order')

      assert_equal order_ids.count, orders.count
    end
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peddler-2.1.1 test/integration/test_orders.rb
peddler-2.1.0 test/integration/test_orders.rb