From 961101beb00486502a0f766eedf2d7873a311c99 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Thu, 3 Feb 2011 22:16:55 -0300 Subject: [PATCH] Avoid exception_notification plugin to try load 404.html --- app/controllers/application.rb | 1 + test/integration/exception_notification_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 60e1c5f..cd10b5a 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -131,6 +131,7 @@ class ApplicationController < ActionController::Base @path ||= request.path render :template => 'shared/not_found.rhtml', :status => 404, :layout => get_layout end + alias :render_404 :render_not_found def render_access_denied(message = nil, title = nil) @no_design_blocks = true diff --git a/test/integration/exception_notification_test.rb b/test/integration/exception_notification_test.rb index 0b2f106..bb3c3da 100644 --- a/test/integration/exception_notification_test.rb +++ b/test/integration/exception_notification_test.rb @@ -25,4 +25,9 @@ class ExceptionNotificationTest < ActionController::IntegrationTest assert_includes ActionMailer::Base.deliveries.map(&:to).flatten, 'admin@example.com' assert_includes ActionMailer::Base.deliveries.map(&:to).flatten, 'user@example.com' end + + should 'render not found when try to access invalid url' do + get '/profile/ze/tag/notexists' + assert_template 'not_found.rhtml' + end end -- libgit2 0.21.2