diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2019-03-26 19:08:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-26 19:08:55 -0400 |
commit | c2093cdf8e48ccc4211195c3523319a1767a205a (patch) | |
tree | 5d0ba713e1ddec06004e8dd080805a9dc81abff2 /actionpack/test/dispatch/show_exceptions_test.rb | |
parent | 2cf39747123a3a666264ba58401453b66b382b9c (diff) | |
parent | 378b4fedb1d4b55e642e82d0a7b273803118ca30 (diff) | |
download | rails-c2093cdf8e48ccc4211195c3523319a1767a205a.tar.gz rails-c2093cdf8e48ccc4211195c3523319a1767a205a.tar.bz2 rails-c2093cdf8e48ccc4211195c3523319a1767a205a.zip |
Merge pull request #35753 from Edouard-chin/ec-mimetype-rescue
Add the `Mime::Type::InvalidMimeType` error in the default rescue_response:
Diffstat (limited to 'actionpack/test/dispatch/show_exceptions_test.rb')
-rw-r--r-- | actionpack/test/dispatch/show_exceptions_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index f802abc653..6fafa4e426 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -9,6 +9,8 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest case req.path when "/not_found" raise AbstractController::ActionNotFound + when "/invalid_mimetype" + raise Mime::Type::InvalidMimeType when "/bad_params", "/bad_params.json" begin raise StandardError.new @@ -62,6 +64,10 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest get "/unknown_http_method", env: { "action_dispatch.show_exceptions" => true } assert_response 405 assert_equal "", body + + get "/invalid_mimetype", headers: { "Accept" => "text/html,*", "action_dispatch.show_exceptions" => true } + assert_response 406 + assert_equal "", body end test "localize rescue error page" do |