aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/log_subscriber_test.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2012-09-16 21:48:24 +0200
committerYves Senn <yves.senn@garaio.com>2012-09-17 18:16:41 +0200
commit370dcd99b7635f6a5075da73de27c6da59a8553b (patch)
tree04c90a966a3a64e4222594bd36ad35eced002457 /actionpack/test/controller/log_subscriber_test.rb
parent3c48b32f6e4a00e5d3d5d24988710894b992fb21 (diff)
downloadrails-370dcd99b7635f6a5075da73de27c6da59a8553b.tar.gz
rails-370dcd99b7635f6a5075da73de27c6da59a8553b.tar.bz2
rails-370dcd99b7635f6a5075da73de27c6da59a8553b.zip
log 404 status when ActiveRecord::RecordNotFound was raised (#7646)
Diffstat (limited to 'actionpack/test/controller/log_subscriber_test.rb')
-rw-r--r--actionpack/test/controller/log_subscriber_test.rb15
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