spec/lib/onebox/engine/amazon_onebox_spec.rb in onebox-1.1.0 vs spec/lib/onebox/engine/amazon_onebox_spec.rb in onebox-1.2.0
- old
+ new
@@ -1,37 +1,22 @@
require "spec_helper"
describe Onebox::Engine::AmazonOnebox do
before(:all) do
@link = "http://www.amazon.com/Knit-Noro-Accessories-Colorful-Little/dp/193609620X"
- fake(@link, response(described_class.template_name))
+ @uri = "http://www.amazon.com/gp/aw/d/193609620X"
end
- before(:each) { Onebox.defaults.cache.clear }
- let(:link) { @link }
-
+ include_context "engines"
it_behaves_like "an engine"
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]")
+ it "includes image" do
+ expect(html).to include("img")
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
+ it "includes 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