Sha256: d2d4ee79b733383bd2268f405f1c02562b0676da77fb9873929e21944f73fb92

Contents?: true

Size: 707 Bytes

Versions: 2

Compression:

Stored size: 707 Bytes

Contents

require "spec_helper"

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

  it_behaves_like "engines"

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

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

    it "returns the article title" do
      expect(html).to include("Kevin Bacon")
    end

    it "returns the article img src" do
      expect(html).to include("225px-Kevin_Bacon_Comic-Con_2012.jpg")
    end

    it "returns the article summary" do
      expect(html).to include("Kevin Norwood Bacon[1] (born July 8, 1958)")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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