From 7927fc2ff77543a0ab151ac1cb3d60318e2dfa68 Mon Sep 17 00:00:00 2001 From: Doug Fales Date: Tue, 18 Jan 2011 15:36:08 -0700 Subject: A patch so that http status codes are still included in logs even during an exception [#6333 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionpack/test/controller/log_subscriber_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index cac0881133..21bbd83653 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -32,6 +32,11 @@ module Another cache_page("Super soaker", "/index.html") render :nothing => true end + + def with_exception + raise Exception + end + end end @@ -168,6 +173,16 @@ class ACLogSubscriberTest < ActionController::TestCase ensure @controller.config.perform_caching = true end + + def test_process_action_with_exception_includes_http_status_code + begin + get :with_exception + wait + rescue Exception => e + end + assert_equal 2, logs.size + assert_match(/Completed 500/, logs.last) + end def logs @logs ||= @logger.logged(:info) -- cgit v1.2.3