Permalink
Browse files

Make ActionController::TestCase#recycle! set @protocol to nil

This ensures that the protocol does not get carried over when there are
two or more requests in functional tests. This was a problem when e.g.
the first request was HTTP and the second request was HTTPS.

Closes #2654.

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
  • Loading branch information...
1 parent ebea387 commit 68a13eded347248fb9d4c8ef7f0ed2af52bba994 @dmajda dmajda committed with pixeltrix Aug 23, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/test_case.rb
@@ -180,7 +180,7 @@ def recycle!
@env.delete_if { |k, v| k =~ /^action_dispatch\.rescue/ }
@symbolized_path_params = nil
@method = @request_method = nil
- @fullpath = @ip = @remote_ip = nil
+ @fullpath = @ip = @remote_ip = @protocol = nil
@env['action_dispatch.request.query_parameters'] = {}
@set_cookies ||= {}
@set_cookies.update(Hash[cookie_jar.instance_variable_get("@set_cookies").map{ |k,o| [k,o[:value]] }])

0 comments on commit 68a13ed

Please sign in to comment.