Sha256: 914b3550ad195bd50dee8f245fe66ba6d41bdaec68055462897f12df19973ddf

Contents?: true

Size: 812 Bytes

Versions: 1

Compression:

Stored size: 812 Bytes

Contents

require "spec_helper"

describe Onebox::Engine::WikipediaOnebox do
  before(:all) do
    @link = "http://en.wikipedia.org/wiki/Kevin_Bacon"
    fake(@link, response(described_class.template_name))
  end
  before(:each) { Onebox.defaults.cache.clear }

  let(:link) { @link }

  it_behaves_like "an engine"

  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

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.1.0 spec/lib/onebox/engine/wikipedia_onebox_spec.rb