Sha256: 6d8f233f950f1b6fbde588c5c364f0a3b25b8b93c0525217395541f3886612a1

Contents?: true

Size: 943 Bytes

Versions: 2

Compression:

Stored size: 943 Bytes

Contents

# frozen_string_literal: true

require 'integration_helper'
require 'mws/feeds'

class TestFeeds < IntegrationTest
  def test_getting_feed_submission_count
    clients.each do |client|
      res = client.get_feed_submission_count
      refute_empty res.parse
    end
  end

  def test_getting_feed_submission_list
    clients.each do |client|
      res = client.get_feed_submission_list
      refute_empty res.parse
    end
  end

  def test_submitting_feeds
    feed_content = "sku\tprice\tquantity\nwidget\t\t0\n"
    feed_type = '_POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA_'

    clients.each do |client|
      res = client.submit_feed(feed_content, feed_type)
      feed_submission_id = res.dig('FeedSubmissionInfo', 'FeedSubmissionId')
      assert feed_submission_id

      # Clean up
      client.cancel_feed_submissions(
        feed_submission_id: feed_submission_id,
        feed_type_list: feed_type
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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