Sha256: e80cda3c403b17ce5db9c4c6e559e87bc550a93b5f6eac085167973c4cb0ed1e

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

require "spec_helper"

module Sucker
  describe "Kindle" do
    context "Book index" do
      use_vcr_cassette "integration/kindle", :record => :new_episodes

      let(:items) do
        worker = Sucker.new(
          :locale => "us",
          :key    => amazon["key"],
          :secret => amazon["secret"])
        worker << {
          "Operation"     => "ItemSearch",
          "SearchIndex"   => "Books",
          "Power"         => "deleuze binding:kindle",
          "ResponseGroup" => "ItemAttributes" }
        worker.get.find("Item")
      end

      it "finds Kindle books" do
        items.first["ItemAttributes"]["Title"].should_not be_nil
      end
    end

    context "Kindle store index" do
      use_vcr_cassette "integration/kindle_2", :record => :new_episodes

      let(:items) do
        worker = Sucker.new(
          :locale => "us",
          :key    => amazon["key"],
          :secret => amazon["secret"])
        worker << {
          "Operation"     => "ItemSearch",
          "SearchIndex"   => "KindleStore",
          "Keywords"      => "deleuze",
          "ResponseGroup" => "ItemAttributes" }
        worker.get.find("Item")
      end

      it "finds Kindle books" do
        items.first["ItemAttributes"]["Title"].should_not be_nil
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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