Sha256: 7254dff5cc75a6d2c98b20ab8c80e8dfef27510173f3603df9f8d10bf06117a8

Contents?: true

Size: 673 Bytes

Versions: 2

Compression:

Stored size: 673 Bytes

Contents

require "spec_helper"

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

  it_behaves_like "engines"

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

    it "returns the question title" do
      expect(html).to include("Concept behind these 4 lines of tricky C++ code")
    end

    it "returns the question" do
      expect(html).to include("Why does this code gives output C++Sucks? Can anyone explain the concept behind it?")
    end

    it "returns the question 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/stack_exchange_spec.rb
onebox-1.0.0 spec/lib/onebox/engine/stack_exchange_spec.rb