Sha256: 2b96c221a05e68a80782753b622fdad4313cd8c6db7f2256c7344dcb43e2c99b

Contents?: true

Size: 770 Bytes

Versions: 4

Compression:

Stored size: 770 Bytes

Contents

require "spec_helper"

module Sucker
  describe "Images response group" do
    before do
      @worker = Sucker.new(
        :locale => "us",
        :key    => amazon["key"],
        :secret => amazon["secret"])

      @worker << {
        "Operation"     => "ItemLookup",
        "IdType"        => "ASIN",
        "ResponseGroup" => "Images" }

      Sucker.stub(@worker)

      @worker << { "ItemId" => "0816614024" }
      @item = @worker.get.node("Item").first
    end

    it "has an ASIN" do
      @item["ASIN"].should eql "0816614024"
    end

    it "has a large image URL" do
      @item["LargeImage"]["URL"].should match /^http.*jpg$/
    end

    it "has an image set" do
      @item["ImageSets"]["ImageSet"].should be_an_instance_of Hash
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sucker-0.9.2 spec/integration/images_spec.rb
sucker-0.9.1 spec/integration/images_spec.rb
sucker-0.9.0 spec/integration/images_spec.rb
sucker-0.8.0 spec/integration/images_spec.rb