From b627b9bcb98cbf65b539f170a29d53f108ecde8b Mon Sep 17 00:00:00 2001 From: Dirk Kelly Date: Tue, 1 Feb 2011 16:07:18 +0800 Subject: [PATCH] going for the positive, instead of the double negative (listed not unlisted) --- app/models/page.rb | 2 +- spec/models/page_spec.rb | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/models/page.rb b/app/models/page.rb index 950b055c..42b15096 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -9,7 +9,7 @@ class Page include Models::Extensions::Page::Render include Models::Extensions::Page::Templatized include Models::Extensions::Page::Redirect - include Models::Extensions::Page::Unlisted + include Models::Extensions::Page::Listed ## fields ## field :title diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb index 22bfaa6d..d2e06030 100644 --- a/spec/models/page_spec.rb +++ b/spec/models/page_spec.rb @@ -206,14 +206,16 @@ describe Page do end - describe 'unlisted extension' do + describe 'listed extension' do - before(:each) do - @page = Factory.build(:page, :site => nil, :unlisted => true, :content_type_id => 42) + it 'is considered as a visible page' do + @page = Factory.build(:page, :site => nil, :content_type_id => 42) + @page.listed?.should be_true end - - it 'is considered as a unlisted page' do - @page.unlisted?.should be_true + + it 'is not considered as a visible page' do + @page = Factory.build(:page, :site => nil, :listed => false, :content_type_id => 42) + @page.listed?.should be_false end end