Sha256: f64e698d73e73f0327d0981583ab99074b33a6c02a2ee2e8a1be682f052490a5

Contents?: true

Size: 912 Bytes

Versions: 2

Compression:

Stored size: 912 Bytes

Contents

require "spec_helper"

describe Onebox::Engine::AmazonOnebox do
  let(:link) { "http://amazon.com" }
  before do
    fake(link, response("amazon.response"))
  end

  it_behaves_like "engines"

  describe "#to_html" do
    let(:html) { described_class.new(link).to_html }

    it "returns the product title" do
      expect(html).to include("Knit Noro: Accessories: 30 Colorful Little Knits [Hardcover]")
    end

    it "returns the product image" do
      expect(html).to include("61mI3YmHVnL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg")
    end

    it "returns the product description" do
      expect(html).to include("Using only the finest natural materials and ecologically sound")
    end

    it "returns the product price" do
      expect(html).to include("$18.77")
    end

    it "returns the product URL" do
      expect(html).to include(link)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onebox-1.0.1 spec/lib/onebox/engine/amazon_spec.rb
onebox-1.0.0 spec/lib/onebox/engine/amazon_spec.rb