diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-16 09:59:36 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-16 10:45:59 +0100 |
commit | 5359262695b491422b18c565567e16ad50f6155e (patch) | |
tree | 69165f0c57d5a87852b74936a99707d1516b07da /actionpack/test | |
parent | 7dd1c751f90858cbdfaebeafed5fdf1ef400ae8b (diff) | |
download | rails-5359262695b491422b18c565567e16ad50f6155e.tar.gz rails-5359262695b491422b18c565567e16ad50f6155e.tar.bz2 rails-5359262695b491422b18c565567e16ad50f6155e.zip |
ShowExceptions should understand X-Cascade responses from exceptions app.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/show_exceptions_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index 0ebe281ada..e9504f3524 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -88,4 +88,15 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest assert_response 404 assert_equal "YOU FAILED BRO", body end + + test "returns an empty response if custom exceptions app returns X-Cascade pass" do + exceptions_app = lambda do |env| + [404, { "X-Cascade" => "pass" }, []] + end + + @app = ActionDispatch::ShowExceptions.new(Boomer.new, exceptions_app) + get "/method_not_allowed", {}, {'action_dispatch.show_exceptions' => true} + assert_response 405 + assert_equal "", body + end end |