Permalink
Browse files

Raise a routing error for missing pages so that Rails will use public…

…/404.html
  • Loading branch information...
jferris committed Oct 25, 2010
1 parent 7e89687 commit ab73b7d9357e5b8d89bcccc0bb8a943241e42dc4
Showing with 5 additions and 4 deletions.
  1. +1 −1 app/controllers/high_voltage/pages_controller.rb
  2. +4 −3 test/pages_controller_test.rb
@@ -11,7 +11,7 @@ def show
protected
def invalid_page
- render :nothing => true, :status => 404
+ raise ActionController::RoutingError, "No such page: #{params[:id]}"
end
def current_page
@@ -10,8 +10,9 @@ class HighVoltage::PagesControllerTest < ActionController::TestCase
should render_template('exists')
end
- context "on GET to /pages/invalid" do
- setup { get :show, :id => "invalid" }
- should respond_with(:missing)
+ should "raise a routing error for an invalid page" do
+ assert_raise ActionController::RoutingError do
+ get :show, :id => "invalid"
+ end
end
end

0 comments on commit ab73b7d

Please sign in to comment.