From c82248ea8647619cafe47d16945a45fcbf8196ef Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 24 Aug 2015 17:07:48 -0700 Subject: [PATCH] remove more direct `env` mutations --- actionpack/lib/action_controller/test_case.rb | 4 +++- actionpack/test/controller/test_case_test.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 9ac2339789..103986e44a 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -98,7 +98,9 @@ module ActionController set_header 'rack.input', StringIO.new(data) end - @env["PATH_INFO"] ||= generated_path + get_header("PATH_INFO") do |k| + set_header k, generated_path + end path_parameters[:controller] = controller_path path_parameters[:action] = action diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index 1f073b4124..b3c3979c84 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -160,7 +160,7 @@ XML def setup super @controller = TestController.new - @request.env['PATH_INFO'] = nil + @request.delete_header 'PATH_INFO' @routes = ActionDispatch::Routing::RouteSet.new.tap do |r| r.draw do get ':controller(/:action(/:id))'