Sha256: 28d815eafa3120a2de2118b03e69d4e02b5cb39b2eeec3ef6f4c9c90a528ab56

Contents?: true

Size: 885 Bytes

Versions: 20

Compression:

Stored size: 885 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Inventory" do
  it "loads the first page of inventory data" do
    AmazonSellerCentral.mechanizer.reset!
    page = AmazonSellerCentral::Inventory.load_first_page
    page.should be_kind_of(AmazonSellerCentral::InventoryPage)
    page.body.should =~ INVENTORY_FIRST_PAGE_TEST_REGEX
  end

  it "loads all inventory pages" do
    AmazonSellerCentral.mechanizer.reset!
    pages = AmazonSellerCentral::Inventory.load_all_pages
    pages.size.should == 3
    pages.first.body.should =~ INVENTORY_FIRST_PAGE_TEST_REGEX
    pages.last.body.should =~ INVENTORY_LAST_PAGE_TEST_REGEX
  end

  it "passes a page to a block when given" do
    last_seen = nil
    AmazonSellerCentral::Inventory.each_page do |page|
      last_seen = page
    end
    last_seen.body.should =~ INVENTORY_LAST_PAGE_TEST_REGEX
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
amazon_seller_central-0.3.2 spec/lib/inventory_spec.rb
amazon_seller_central-0.3.1 spec/lib/inventory_spec.rb
amazon_seller_central-0.3.0 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.16 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.15 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.14 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.13 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.12 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.11 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.10 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.9 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.8 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.7 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.6 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.5 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.4 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.3 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.2 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.1 spec/lib/inventory_spec.rb
amazon_seller_central-0.2.0 spec/lib/inventory_spec.rb