Sha256: 7afb0cf193ed8b4cdd93055b2ca691bcf01bd995aee6147aed842ea7903a7e18

Contents?: true

Size: 897 Bytes

Versions: 2

Compression:

Stored size: 897 Bytes

Contents

# http://github.com/papercavalier/sucker/issues#issue/2

require "spec_helper"

module Sucker
  describe "Item Search" do
    use_vcr_cassette "integration/item_search", :record => :new_episodes

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

      worker << {
        "Operation"     => "ItemSearch",
        "SearchIndex"   => "Books",
        "Author"        => "Orwell" }
      worker
    end

    it "works for Orwell" do
      worker.get.should be_valid
    end

    it "works for George Orwell, too" do
      worker << {
        "Operation"     => "ItemSearch",
        "SearchIndex"   => "Books",
        "Author"        => "George Orwell" }

      response = worker.get
      response.should be_valid
      response.find("TotalPages").first.should be_an_instance_of String
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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