Sha256: 0a97769d10c242dfa98f04ed8e58be1928cebd31338cf1491dcf02b2a2c5bc3b

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 Bytes

Contents

require "spec_helper"

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

  describe "#render" do
    subject { page_content.render }

    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" }}
		
			pending "currently renders as 'html'. Consider using #render_image in #render."
			# 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.0.4 spec/lib/thesis/models/page_content_spec.rb