diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-16 10:38:17 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-16 10:45:59 +0100 |
commit | 654df86b7b022085785a64c431c45d8450d5e987 (patch) | |
tree | 59daaf75560cd1e128cf67a83afd7f218ba9dccd /actionpack/test/controller | |
parent | 192e55c38ed9b48672b9e216c9805b782b835d78 (diff) | |
download | rails-654df86b7b022085785a64c431c45d8450d5e987.tar.gz rails-654df86b7b022085785a64c431c45d8450d5e987.tar.bz2 rails-654df86b7b022085785a64c431c45d8450d5e987.zip |
Show detailed exceptions no longer returns true if the request is local in production.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_base/render_template_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/controller/show_exceptions_test.rb | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index ba804421da..ade204c387 100644 --- a/actionpack/test/controller/new_base/render_template_test.rb +++ b/actionpack/test/controller/new_base/render_template_test.rb @@ -59,6 +59,12 @@ module RenderTemplate def with_error render :template => "test/with_error" end + + private + + def show_detailed_exceptions? + request.local? + end end class TestWithoutLayout < Rack::TestCase diff --git a/actionpack/test/controller/show_exceptions_test.rb b/actionpack/test/controller/show_exceptions_test.rb index ba78559f31..13ab19ed8f 100644 --- a/actionpack/test/controller/show_exceptions_test.rb +++ b/actionpack/test/controller/show_exceptions_test.rb @@ -16,6 +16,10 @@ module ShowExceptions def another_boom raise 'boom!' end + + def show_detailed_exceptions? + request.local? + end end class ShowExceptionsTest < ActionDispatch::IntegrationTest @@ -26,7 +30,7 @@ module ShowExceptions assert_equal "500 error fixture\n", body end - test 'show diagnostics from a local ip' do + test 'show diagnostics from a local ip if show_detailed_exceptions? is set to request.local?' do @app = ShowExceptionsController.action(:boom) ['127.0.0.1', '127.0.0.127', '::1', '0:0:0:0:0:0:0:1', '0:0:0:0:0:0:0:1%0'].each do |ip_address| self.remote_addr = ip_address |