Sha256: 1a93cd015e0f37c54cee2e21b9cc93f973b422bc6220cb8c2cf1b9ae2ec091d7
Contents?: true
Size: 1.22 KB
Versions: 18
Compression:
Stored size: 1.22 KB
Contents
require "spec_helper" module Refinery module Pages describe PagePartSectionPresenter do it "can be built from a page part" do part = double(PagePart, :body => 'part_body', :title => 'A Wonderful Page Part') section = PagePartSectionPresenter.new(part) section.fallback_html.should == 'part_body' section.id.should == :a_wonderful_page_part end it "marks the body as html safe" do part = double(PagePart, :body => '<p>part_body</p>', :title => nil) section = PagePartSectionPresenter.new(part) section.fallback_html.should be_html_safe section.wrapped_html.should == "<section><div class=\"inner\"><p>part_body</p></div></section>" end it "handles a nil page body" do part = double(PagePart, :body => nil, :title => nil) section = PagePartSectionPresenter.new(part) section.fallback_html.should be_nil section.wrapped_html.should be_nil section.has_content?.should be_false end it "has no id if title is nil" do part = double(PagePart, :body => 'foobar', :title => nil) section = PagePartSectionPresenter.new(part) section.id.should be_nil end end end end
Version data entries
18 entries across 18 versions & 2 rubygems