Permalink
Browse files

Make test pages actually have a Published status

Setting published_at to Time.now does not actually publish the pages.
Setting status to Status[:published] dóes set the published_at date, which is probably why this fault was in here.
  • Loading branch information...
1 parent 9fbbdcc commit 7a5f1dab21bc910fe2834de4e937a117ac2639c0 @jomz jomz committed Feb 13, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 spec/models/page_spec.rb
View
@@ -736,11 +736,11 @@ class ::CustomFileNotFoundPage < FileNotFoundPage
describe Page, "class find_by_path" do
test_helper :page
- let(:home){ Page.create!(page_params(:slug => '/', :published_at => Time.now)) }
- let(:parent){ home.children.create!(page_params(:slug => 'parent', :published_at => Time.now))}
- let(:child){ parent.children.create!(page_params(:slug => 'child', :published_at => Time.now))}
+ let(:home){ Page.create!(page_params(:slug => '/', :status_id => Status[:published].id)) }
+ let(:parent){ home.children.create!(page_params(:slug => 'parent', :status_id => Status[:published].id))}
+ let(:child){ parent.children.create!(page_params(:slug => 'child', :status_id => Status[:published].id))}
let(:draft){ home.children.create!(page_params(:slug => 'draft', :status_id => Status[:draft].id)) }
- let(:file_not_found){ FileNotFoundPage.create!(page_params(parent_id: home.id, :slug => '404', :published_at => Time.now))}
+ let(:file_not_found){ FileNotFoundPage.create!(page_params(parent_id: home.id, :slug => '404', :status_id => Status[:published].id))}
it 'should find the home page' do
home

0 comments on commit 7a5f1da

Please sign in to comment.