From 88ffba232987d00717560eaac7ab4f1104e054cd Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 19 Jan 2010 09:05:34 -0600 Subject: Disable ShowExceptions during integration tests --- .../dispatch/request/json_params_parsing_test.rb | 2 +- .../dispatch/request/xml_params_parsing_test.rb | 2 +- actionpack/test/dispatch/show_exceptions_test.rb | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/request/json_params_parsing_test.rb b/actionpack/test/dispatch/request/json_params_parsing_test.rb index d3308f73cc..0faa99a912 100644 --- a/actionpack/test/dispatch/request/json_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/json_params_parsing_test.rb @@ -35,7 +35,7 @@ class JsonParamsParsingTest < ActionController::IntegrationTest begin $stderr = StringIO.new json = "[\"person]\": {\"name\": \"David\"}}" - post "/parse", json, {'CONTENT_TYPE' => 'application/json'} + post "/parse", json, {'CONTENT_TYPE' => 'application/json', 'action_dispatch.show_exceptions' => true} assert_response :error $stderr.rewind && err = $stderr.read assert err =~ /Error occurred while parsing request parameters/ diff --git a/actionpack/test/dispatch/request/xml_params_parsing_test.rb b/actionpack/test/dispatch/request/xml_params_parsing_test.rb index 96189e4ca2..488799ac2a 100644 --- a/actionpack/test/dispatch/request/xml_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/xml_params_parsing_test.rb @@ -43,7 +43,7 @@ class XmlParamsParsingTest < ActionController::IntegrationTest begin $stderr = StringIO.new xml = "David#{ActiveSupport::Base64.encode64('ABC')}" - post "/parse", xml, default_headers + post "/parse", xml, default_headers.merge('action_dispatch.show_exceptions' => true) assert_response :error $stderr.rewind && err = $stderr.read assert err =~ /Error occurred while parsing request parameters/ diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index def86c8323..97da680f17 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -38,15 +38,15 @@ class ShowExceptionsTest < ActionController::IntegrationTest @app = ProductionApp self.remote_addr = '208.77.188.166' - get "/" + get "/", {}, {'action_dispatch.show_exceptions' => true} assert_response 500 assert_equal "500 error fixture\n", body - get "/not_found" + get "/not_found", {}, {'action_dispatch.show_exceptions' => true} assert_response 404 assert_equal "404 error fixture\n", body - get "/method_not_allowed" + get "/method_not_allowed", {}, {'action_dispatch.show_exceptions' => true} assert_response 405 assert_equal "", body end @@ -56,15 +56,15 @@ class ShowExceptionsTest < ActionController::IntegrationTest ['127.0.0.1', '::1'].each do |ip_address| self.remote_addr = ip_address - get "/" + get "/", {}, {'action_dispatch.show_exceptions' => true} assert_response 500 assert_match /puke/, body - get "/not_found" + get "/not_found", {}, {'action_dispatch.show_exceptions' => true} assert_response 404 assert_match /#{ActionController::UnknownAction.name}/, body - get "/method_not_allowed" + get "/method_not_allowed", {}, {'action_dispatch.show_exceptions' => true} assert_response 405 assert_match /ActionController::MethodNotAllowed/, body end @@ -78,11 +78,11 @@ class ShowExceptionsTest < ActionController::IntegrationTest @app = ProductionApp self.remote_addr = '208.77.188.166' - get "/" + get "/", {}, {'action_dispatch.show_exceptions' => true} assert_response 500 assert_equal "500 localized error fixture\n", body - get "/not_found" + get "/not_found", {}, {'action_dispatch.show_exceptions' => true} assert_response 404 assert_equal "404 error fixture\n", body ensure @@ -94,15 +94,15 @@ class ShowExceptionsTest < ActionController::IntegrationTest @app = DevelopmentApp self.remote_addr = '208.77.188.166' - get "/" + get "/", {}, {'action_dispatch.show_exceptions' => true} assert_response 500 assert_match /puke/, body - get "/not_found" + get "/not_found", {}, {'action_dispatch.show_exceptions' => true} assert_response 404 assert_match /#{ActionController::UnknownAction.name}/, body - get "/method_not_allowed" + get "/method_not_allowed", {}, {'action_dispatch.show_exceptions' => true} assert_response 405 assert_match /ActionController::MethodNotAllowed/, body end -- cgit v1.2.3