From 40e9ba1e4627f1939153e7a061aaf060c87ec902 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 4 Dec 2008 01:24:24 -0600 Subject: Refactor SessionFixationTest and WebServiceTest with IntegrationTest so they are compatible with the Rack interface. --- actionpack/lib/action_controller/dispatcher.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_controller/dispatcher.rb') diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb index 47199af2b4..110f9a88b1 100644 --- a/actionpack/lib/action_controller/dispatcher.rb +++ b/actionpack/lib/action_controller/dispatcher.rb @@ -182,13 +182,21 @@ module ActionController end def failsafe_rescue(exception) - self.class.failsafe_response(@output, '500 Internal Server Error', exception) do - if @controller ||= (::ApplicationController rescue Base) - @controller.process_with_exception(@request, @response, exception).out(@output) - else - raise exception + if @test_request + process_with_exception(exception) + else + self.class.failsafe_response(@output, '500 Internal Server Error', exception) do + process_with_exception(exception) end end end + + def process_with_exception(exception) + if @controller ||= (::ApplicationController rescue Base) + @controller.process_with_exception(@request, @response, exception).out(@output) + else + raise exception + end + end end end -- cgit v1.2.3