aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/show_exceptions_test.rb
diff options
context:
space:
mode:
authorLes Hill and Sandro Turriate <dev+leshill+sandro@hashrocket.com>2010-10-11 10:55:07 -0400
committerJosé Valim <jose.valim@gmail.com>2010-10-12 00:56:07 +0200
commitdde54f00c6c08d1704d011d8108106076e8ea033 (patch)
treee72ea57570e209e88c5431f040b2f8d9634c461b /actionpack/test/dispatch/show_exceptions_test.rb
parent0d3333257156544feba729ba28f6874d5a30d561 (diff)
downloadrails-dde54f00c6c08d1704d011d8108106076e8ea033.tar.gz
rails-dde54f00c6c08d1704d011d8108106076e8ea033.tar.bz2
rails-dde54f00c6c08d1704d011d8108106076e8ea033.zip
Show exceptions rescues the original exception
[#5784 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/dispatch/show_exceptions_test.rb')
-rw-r--r--actionpack/test/dispatch/show_exceptions_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb
index ce6c397e32..2a478c214f 100644
--- a/actionpack/test/dispatch/show_exceptions_test.rb
+++ b/actionpack/test/dispatch/show_exceptions_test.rb
@@ -1,6 +1,7 @@
require 'abstract_unit'
class ShowExceptionsTest < ActionDispatch::IntegrationTest
+
Boomer = lambda do |env|
req = ActionDispatch::Request.new(env)
case req.path
@@ -12,6 +13,8 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest
raise ActionController::NotImplemented
when "/unprocessable_entity"
raise ActionController::InvalidAuthenticityToken
+ when "/not_found_original_exception"
+ raise ActionView::Template::Error.new('template', {}, AbstractController::ActionNotFound.new)
else
raise "puke!"
end
@@ -101,4 +104,21 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest
assert_response 500
assert_match("&quot;foo&quot;=&gt;&quot;[FILTERED]&quot;", body)
end
+
+ test "show registered original exception for wrapped exceptions when consider_all_requests_local is false" do
+ @app = ProductionApp
+ self.remote_addr = '208.77.188.166'
+
+ get "/not_found_original_exception", {}, {'action_dispatch.show_exceptions' => true}
+ assert_response 404
+ assert_match(/404 error/, body)
+ end
+
+ test "show registered original exception for wrapped exceptions when consider_all_requests_local is true" do
+ @app = DevelopmentApp
+
+ get "/not_found_original_exception", {}, {'action_dispatch.show_exceptions' => true}
+ assert_response 404
+ assert_match(/AbstractController::ActionNotFound/, body)
+ end
end