Sha256: 0c8cdce054809ea5bbb638bf3c9c5934f3dfec63ec05e76d4a266a40eb103ba2

Contents?: true

Size: 905 Bytes

Versions: 1

Compression:

Stored size: 905 Bytes

Contents

require "spec_helper"

describe Thesis::PageContent do
  let(:page)         { create(:page) }
  let(:page_content) { create(:page_content, attributes.merge(page: page)) }

  describe "#render" do
    subject { page_content.render(editable: true) }

    context "when the content type is 'html'" do
      let(:attributes) {{ content_type: 'html' }}

      it { should match /thesis-content-html/ }
      it { should match page_content.content }
    end

    context "when the content type is 'text'" do
      let(:attributes) {{ content_type: "text" }}

      it { should match /thesis-content-text/ }
      it { should match page_content.content }
    end

    context "when the content type is 'image'" do
      let(:attributes) {{ content_type: "image" }}

      it { should match /thesis-content-image/ }
      it { should match /img/ }
      it { should match page_content.content }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thesis-0.1.3 spec/thesis/models/page_content_spec.rb