Skip to content

Commit

Permalink
Moved content_for? specs into a new context
Browse files Browse the repository at this point in the history
  • Loading branch information
jls committed Mar 25, 2012
1 parent 3f3c9f3 commit d20a308
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions pages/spec/models/refinery/page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,25 @@ def turn_on_marketable_urls
page.content_for('BoDY').should == "<p>I'm the first page part for this page.</p>"
end

it 'return true when page part has content when using content_for?' do
page.content_for?(:body).should be_true
end

it 'return false when page part does not exist when using content_for?' do
page.parts = page.parts.drop(1)
page.content_for?(:body).should be_false
end
context 'when using content_for?' do

it 'return false when page part does not have any content when using content_for?' do
page.parts.first.content = ''
page.content_for?(:body).should be_false
end
it 'return true when page part has content' do
page.content_for?(:body).should be_true
end

it 'return false when page part does not exist' do
page.parts = []
page.content_for?(:body).should be_false
end

it 'return false when page part does not have any content' do
page.parts.first.content = ''
page.content_for?(:body).should be_false
end

end

it 'return all page part content' do
page.all_page_part_content.should == "<p>I'm the first page part for this page.</p> <p>Closely followed by the second page part.</p>"
end
Expand Down

0 comments on commit d20a308

Please sign in to comment.