From abeb77b2868d185ff7604855f2d5cf198bd9a460 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 1 Mar 2006 16:37:11 +0000 Subject: Make TestProcess methods public for access via Integration::Session. Make return values from some of the Integration::Session methods sane. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3724 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/integration_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/integration_test.rb') diff --git a/actionpack/lib/action_controller/integration_test.rb b/actionpack/lib/action_controller/integration_test.rb index 7c7f19a238..35fec04dd3 100644 --- a/actionpack/lib/action_controller/integration_test.rb +++ b/actionpack/lib/action_controller/integration_test.rb @@ -72,6 +72,7 @@ module ActionController def https!(flag=true) @https = flag initialize_url_writer + @https end # Return +true+ if the session is mimicing a secure HTTPS request. @@ -89,6 +90,7 @@ module ActionController def host!(name) @host = name initialize_url_writer + @host end # Follow a single redirect response. If the last response was not a @@ -97,6 +99,7 @@ module ActionController def follow_redirect! raise "not a redirect! #{@status} #{@status_message}" unless redirect? get(interpret_uri(headers["location"].first)) + status end # Performs a GET request, following any subsequent redirect. Note that @@ -106,6 +109,7 @@ module ActionController def get_via_redirect(path, args={}) get path, args follow_redirect! while redirect? + status end # Performs a POST request, following any subsequent redirect. This is @@ -113,6 +117,7 @@ module ActionController def post_via_redirect(path, args={}) post path, args follow_redirect! while redirect? + status end # Returns +true+ if the last response was a redirect. @@ -217,6 +222,7 @@ module ActionController @response = @controller.response parse_result + return status end # Parses the result of the response and extracts the various values, @@ -254,7 +260,7 @@ module ActionController 'QUERY_STRING' => "", "REQUEST_URI" => "/", "HTTP_HOST" => host, - "SERVER_PORT" => https? ? "80" : "443", + "SERVER_PORT" => https? ? "443" : "80", "HTTPS" => https? ? "on" : "off") @rewriter = ActionController::UrlRewriter.new(ActionController::CgiRequest.new(cgi), {}) end -- cgit v1.2.3