require 'spec_helper'
describe(Jekyll::Gist::GistTag) do
let(:http_output) { "true" }
let(:doc) { doc_with_content(content) }
let(:content) { "{% gist #{gist} %}" }
let(:output) do
doc.content = content
doc.output = Jekyll::Renderer.new(doc.site, doc).run
end
context "valid gist" do
context "with user prefix" do
before { stub_request(:get, "https://gist.githubusercontent.com/#{gist}/raw").to_return(body: http_output) }
let(:gist) { "mattr-/24081a1d93d2898ecf0f" }
it "produces the correct script tag" do
expect(output).to match(/