Sha256: 7373542defad4f3d3503c3caecbe6a4cc58ff5db5b5d1189efa5644f32a41123

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

require 'request_helper'
require 'mws/reports/requests/report_list'

class ReportListRequestTest < RequestTest
  def mock_response_body
    <<-EOF
      <Response xmlns="ns">
        <Result>
        <NextToken>2YgYW55IPQhvu5hbCBwbGVhc3VyZS4=</NextToken>
          <HasNext>true</HasNext>
          <ReportInfo>
            <ReportId>898899473</ReportId>
            <ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType>
            <ReportRequestId>2278662938</ReportRequestId>
            <AvailableDate>2009-02-10T09:22:33+00:00</AvailableDate>
            <Acknowledged>false</Acknowledged>
          </ReportInfo>
        </Result>
      </Response>
    EOF
  end

  def setup
    @reports = MWS::Reports::Requests::ReportList.new(mock_client)
  end

  def test_gets_report_list
    res = @reports.get
    assert_kind_of MWS::Reports::Parsers::ReportList, res
  end

  def test_gets_report_list_by_next_token
    mock_parsed_response = MiniTest::Mock.new
    mock_parsed_response.expect(:next_token, '123')
    @reports.last_parsed_response = mock_parsed_response
    res = @reports.get_by_next_token
    assert_kind_of MWS::Reports::Parsers::ReportList, res
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peddler-0.6.5 test/mws/reports/requests/test_report_list.rb
peddler-0.6.4 test/mws/reports/requests/test_report_list.rb