diff options
author | Yves Senn <yves.senn@gmail.com> | 2012-09-16 21:48:24 +0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-17 13:39:01 -0300 |
commit | dd76b3bbc8c4b161e6d4f77012c90960f68d1ac3 (patch) | |
tree | 9c011f81fd0c4ae9a33410686cfdc5901d0da9e4 /actionpack/test | |
parent | ee439895759b38431ad025f3c234831f30dadcdb (diff) | |
download | rails-dd76b3bbc8c4b161e6d4f77012c90960f68d1ac3.tar.gz rails-dd76b3bbc8c4b161e6d4f77012c90960f68d1ac3.tar.bz2 rails-dd76b3bbc8c4b161e6d4f77012c90960f68d1ac3.zip |
log 404 status when ActiveRecord::RecordNotFound was raised (#7646)
Conflicts:
actionpack/CHANGELOG.md
actionpack/lib/action_controller/log_subscriber.rb
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/log_subscriber_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
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 |