Sha256: 8a96b6477afb79b526244b1b8eeed147f3b1b2e93f7cae3bb4a6f5091730982d

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

require "spec_helper"

describe Onebox::Engine::GithubBlobOnebox do
  let(:link) { "https://github.com/discourse/discourse/blob/master/lib/oneboxer/github_blob_onebox.rb" }
  before do
    fake(link, response("githubblob"))
  end

  it_behaves_like "an engine"

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

    it "has file name" do
      expect(html).to include("github_blob_onebox.rb")
    end

    it "has number of lines" do
      expect(html).to include("50")
    end

    it "has blob contents" do
      expect(html).to include("module Oneboxer")
    end

    it "has URL" do
      expect(html).to include(link)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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