From 26e7400cc5415dbce5e2c5d13da96ad8c25749e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 15 Dec 2011 19:43:49 +0100 Subject: Fix diagnostics page for routing errors. --- actionpack/test/controller/show_exceptions_test.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/show_exceptions_test.rb b/actionpack/test/controller/show_exceptions_test.rb index 5eff1eb09d..2f5c268330 100644 --- a/actionpack/test/controller/show_exceptions_test.rb +++ b/actionpack/test/controller/show_exceptions_test.rb @@ -5,9 +5,17 @@ module ShowExceptions use ActionDispatch::ShowExceptions use ActionDispatch::DebugExceptions + before_filter :only => :another_boom do + request.env["action_dispatch.show_detailed_exceptions"] = true + end + def boom raise 'boom!' end + + def another_boom + raise 'boom!' + end end class ShowExceptionsTest < ActionDispatch::IntegrationTest @@ -27,9 +35,8 @@ module ShowExceptions end end - test 'show diagnostics from a remote ip when consider_all_requests_local is true' do - ShowExceptionsController.any_instance.stubs(:consider_all_requests_local).returns(true) - @app = ShowExceptionsController.action(:boom) + test 'show diagnostics from a remote ip when env is already set' do + @app = ShowExceptionsController.action(:another_boom) self.remote_addr = '208.77.188.166' get '/' assert_match(/boom/, body) -- cgit v1.2.3