Sha256: a3a840e1eea8621d6ab40dd0e5f167952863ffcb1896e14ad2b9c14bd241d61a

Contents?: true

Size: 813 Bytes

Versions: 1

Compression:

Stored size: 813 Bytes

Contents

# encoding: utf-8
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.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

1 entries across 1 versions & 1 rubygems

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