Sha256: 520e034c91514c7169f51ae5eb9a875ff863031713ab2942c8ac2f4adae8cf9a

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

require 'test_helper'

class ProductsTest < Minitest::Test

  def setup
    @config = YAML.load_file( File.join(File.dirname(__FILE__), 'test_config.yml') )['test']
    @connection = Amazon::MWS::Base.new(@config)
  end

  def test_get_matching_product
    @connection.stubs(:post).returns(xml_for('get_matching_product',200))
    response = @connection.get_matching_product(["B00828DQGM"])
    assert_kind_of GetMatchingProductResponse, response

    response = @connection.get_matching_product(["B00828DQGM"], {:raw_xml => true})
    assert_kind_of Net::HTTPOK, response		
  end

  def test_get_matching_product_for_id
    @connection.stubs(:post).returns(xml_for('get_matching_product_for_id',200))
    response = @connection.get_matching_product_for_id('ASIN',["B00828DQGM"])
    assert_kind_of GetMatchingProductForIdResponse, response

    response = @connection.get_matching_product_for_id('ASIN',["B00828DQGM"], :raw_xml => true)
    assert_kind_of Net::HTTPOK, response		
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amazon-mws-plus-0.1.3 test/products_test.rb