Permalink
Browse files

Page.find_by_url → Page.find_by_path

  • Loading branch information...
joshfrench committed Dec 15, 2010
1 parent 57ea710 commit b8d743536532744e64112290c2178f27cec9d082
Showing with 5 additions and 5 deletions.
  1. +1 −1 app/controllers/site_controller.rb
  2. +4 −4 spec/controllers/site_controller_spec.rb
@@ -53,7 +53,7 @@ def set_cache_control
end
def find_page(url)
- found = Page.find_by_url(url, live?)
+ found = Page.find_by_path(url, live?)
found if found and (found.published? or dev?)
end
@@ -28,7 +28,7 @@
end
it "should redirect to admin if missing root" do
- Page.should_receive(:find_by_url).and_raise(Page::MissingRootPageError)
+ Page.should_receive(:find_by_path).and_raise(Page::MissingRootPageError)
get :show_page, :url => '/'
response.should redirect_to(welcome_url)
end
@@ -146,7 +146,7 @@
it "should prevent upstream caching when the page should not be cached" do
@page = pages(:home)
- Page.should_receive(:find_by_url).and_return(@page)
+ Page.should_receive(:find_by_path).and_return(@page)
@page.should_receive(:cache?).and_return(false)
get :show_page, :url => '/'
response.headers['Cache-Control'].should =~ /private/
@@ -174,9 +174,9 @@
describe "pagination" do
it "should pass through pagination parameters to the page" do
@page = pages(:home)
- Page.stub!(:find_by_url).and_return(@page)
+ Page.stub!(:find_by_path).and_return(@page)
@page.should_receive(:pagination_parameters=).with({:page => '3', :per_page => '12'})
get :show_page, :url => '/', :page => '3', :per_page => '12'
end
end
-end
+end

0 comments on commit b8d7435

Please sign in to comment.