Sha256: 692fe2e2021e54c9bc4120b70b1afa66cf1a296f50365c9cb9f184f688b99e4c

Contents?: true

Size: 641 Bytes

Versions: 8

Compression:

Stored size: 641 Bytes

Contents

require 'spec_helper'

describe Storytime do
  describe ".snippet" do
    context "when the snippet doesn't exist" do
      it "returns a blank string" do
        expect(Storytime.snippet("missing")).to be_blank
      end
    end

    context "when the snippet exists" do
      let(:snippet){ FactoryGirl.create(:snippet) }
      let(:returned_content){ Storytime.snippet(snippet.name) }
      it "returns the content of a snippet with the passed name" do
        expect(returned_content).to eq(snippet.content)
      end

      it "returns an html safe string" do
        expect(returned_content).to be_html_safe
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
storytime-1.2.0 spec/lib/storytime_spec.rb
storytime-1.1.1 spec/lib/storytime_spec.rb
storytime-1.0.7 spec/lib/storytime_spec.rb
storytime-1.0.6 spec/lib/storytime_spec.rb
storytime-1.0.5 spec/lib/storytime_spec.rb
storytime-1.0.2 spec/lib/storytime_spec.rb
storytime-1.0.1 spec/lib/storytime_spec.rb
storytime-1.0.0 spec/lib/storytime_spec.rb