Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Make process reuse the env var passed as argument"

This reverts commit 0e4748c.
  • Loading branch information...
commit 3200cd072e4f76dff844a7941326d69c80e7ca8c 1 parent 7f8f1f3
@spastorino spastorino authored
View
8 actionpack/lib/action_dispatch/testing/integration.rb
@@ -244,8 +244,8 @@ def _mock_session
end
# Performs the actual request.
- def process(method, path, parameters = nil, env = nil)
- env ||= {}
+ def process(method, path, parameters = nil, rack_env = nil)
+ rack_env ||= {}
if path =~ %r{://}
location = URI.parse(path)
https! URI::HTTPS === location if location.scheme
@@ -261,7 +261,7 @@ def process(method, path, parameters = nil, env = nil)
hostname, port = host.split(':')
- default_env = {
+ env = {
:method => method,
:params => parameters,
@@ -279,7 +279,7 @@ def process(method, path, parameters = nil, env = nil)
session = Rack::Test::Session.new(_mock_session)
- env.reverse_merge!(default_env)
+ env.merge!(rack_env)
# NOTE: rack-test v0.5 doesn't build a default uri correctly
# Make sure requested path is always a full uri
View
7 actionpack/test/controller/integration_test.rb
@@ -522,11 +522,10 @@ def app
assert_raise(NameError) { missing_path }
end
- test "process reuse the env we pass as argument" do
+ test "process do not modify the env passed as argument" do
env = { :SERVER_NAME => 'server', 'action_dispatch.custom' => 'custom' }
+ old_env = env.dup
get '/foo', nil, env
- assert_equal :get, env[:method]
- assert_equal 'server', env[:SERVER_NAME]
- assert_equal 'custom', env['action_dispatch.custom']
+ assert_equal old_env, env
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.