From dd76b3bbc8c4b161e6d4f77012c90960f68d1ac3 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sun, 16 Sep 2012 21:48:24 +0200 Subject: log 404 status when ActiveRecord::RecordNotFound was raised (#7646) Conflicts: actionpack/CHANGELOG.md actionpack/lib/action_controller/log_subscriber.rb --- actionpack/test/controller/log_subscriber_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 700fd788fa..a72b6dde1a 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -54,6 +54,10 @@ module Another def with_rescued_exception raise SpecialException end + + def with_action_not_found + raise AbstractController::ActionNotFound + end end end @@ -225,6 +229,17 @@ class ACLogSubscriberTest < ActionController::TestCase assert_match(/Completed 406/, logs.last) end + def test_process_action_with_with_action_not_found_logs_404 + begin + get :with_action_not_found + wait + rescue AbstractController::ActionNotFound + end + + assert_equal 2, logs.size + assert_match(/Completed 404/, logs.last) + end + def logs @logs ||= @logger.logged(:info) end -- cgit v1.2.3