diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2015-04-21 16:45:43 -0400 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2015-06-11 16:54:13 -0300 |
commit | e7b89f10813e16936f305b0cc5456c7e37e8ee9a (patch) | |
tree | 031b4f5f9fe954fcd71cebd541d30e280b53e3fe /actionpack/test | |
parent | 38818c93a9959118a87bbdeda16e0766adc67598 (diff) | |
download | rails-e7b89f10813e16936f305b0cc5456c7e37e8ee9a.tar.gz rails-e7b89f10813e16936f305b0cc5456c7e37e8ee9a.tar.bz2 rails-e7b89f10813e16936f305b0cc5456c7e37e8ee9a.zip |
Remove Unneeded ApiPublicExceptions middleware, PublicExceptions already does the work
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/show_exceptions_test.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index c70bc5f95e..a7cd56f263 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -23,7 +23,6 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest end ProductionApp = ActionDispatch::ShowExceptions.new(Boomer.new, ActionDispatch::PublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")) - ProductionApiApp = ActionDispatch::ShowExceptions.new(Boomer.new, ActionDispatch::ApiPublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")) test "skip exceptions app if not showing exceptions" do @app = ProductionApp @@ -56,42 +55,6 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest assert_equal "", body end - test "rescue api apps with json response" do - @app = ProductionApiApp - - get "/", headers: { 'HTTP_ACCEPT' => 'application/json', 'action_dispatch.show_exceptions' => true } - assert_response 500 - assert_equal({ :status => '500', :error => 'puke!' }.to_json, body) - - get "/method_not_allowed", headers: { 'HTTP_ACCEPT' => 'application/json', 'action_dispatch.show_exceptions' => true } - assert_response 405 - assert_equal({ :status => '405', :error => 'Only PUT requests are allowed.' }.to_json, body) - - get "/unknown_http_method", headers: { 'HTTP_ACCEPT' => 'application/json', 'action_dispatch.show_exceptions' => true } - assert_response 405 - assert_equal({ :status => '405', :error => 'ActionController::UnknownHttpMethod' }.to_json, body) - end - - test "rescue api apps unknown content-type requests with html response" do - @app = ProductionApiApp - - get "/", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } - assert_response 500 - assert_equal "500 error fixture\n", body - - get "/bad_params", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } - assert_response 400 - assert_equal "400 error fixture\n", body - - get "/not_found", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } - assert_response 404 - assert_equal "404 error fixture\n", body - - get "/unknown_http_method", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } - assert_response 405 - assert_equal("", body) - end - test "localize rescue error page" do old_locale, I18n.locale = I18n.locale, :da |