Sha256: 3c2bfa0928a55410901ae5b9b8131be3a4d01f7c05be625949e18f1c607120e0

Contents?: true

Size: 795 Bytes

Versions: 2

Compression:

Stored size: 795 Bytes

Contents

require "spec_helper"

module Sucker
  describe "Images response group" do
    use_vcr_cassette "integration/images", :record => :new_episodes

    let(:item) do
      worker = Sucker.new(
        :locale => "us",
        :key    => amazon["key"],
        :secret => amazon["secret"])

      worker << {
        "Operation"     => "ItemLookup",
        "IdType"        => "ASIN",
        "ResponseGroup" => "Images",
        "ItemId"        => "0816614024" }
      worker.get.find("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

2 entries across 2 versions & 1 rubygems

Version Path
sucker-1.0.0.beta.4 spec/integration/images_spec.rb
sucker-1.0.0.beta.3 spec/integration/images_spec.rb