diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 17:37:47 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 17:37:47 -0700 |
commit | 142d50e52e5d33f061fa2909463c49e17dd4ddd1 (patch) | |
tree | 9ff0584e8cbbab8d7a7bff6335ae91e490481919 /actionpack/lib/action_controller | |
parent | 5ee27630f79588f9e97c4bd1c55184b9f3616d25 (diff) | |
download | rails-142d50e52e5d33f061fa2909463c49e17dd4ddd1.tar.gz rails-142d50e52e5d33f061fa2909463c49e17dd4ddd1.tar.bz2 rails-142d50e52e5d33f061fa2909463c49e17dd4ddd1.zip |
make the default environment have actual defaults
instead of deleting keys on every instantiation, create defaults we
actually use. eventually we can pass an environment in to the request,
and create a new req / res object on each call.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 2ac9ce2877..1f5b8e46a2 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -143,6 +143,9 @@ module ActionController end class TestRequest < ActionDispatch::TestRequest #:nodoc: + DEFAULT_ENV = ActionDispatch::TestRequest::DEFAULT_ENV.dup + DEFAULT_ENV.delete 'PATH_INFO' + def initialize(env = {}) super @@ -207,6 +210,12 @@ module ActionController cookie_jar.update(@set_cookies) cookie_jar.recycle! end + + private + + def default_env + DEFAULT_ENV + end end class TestResponse < ActionDispatch::TestResponse @@ -518,8 +527,6 @@ module ActionController @controller ||= klass.new rescue nil end - @request.env.delete('PATH_INFO') - if defined?(@controller) && @controller @controller.request = @request @controller.params = {} |