From 142d50e52e5d33f061fa2909463c49e17dd4ddd1 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 3 Jul 2012 17:37:47 -0700 Subject: 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. --- actionpack/lib/action_dispatch/testing/test_request.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/testing/test_request.rb') diff --git a/actionpack/lib/action_dispatch/testing/test_request.rb b/actionpack/lib/action_dispatch/testing/test_request.rb index a86b510719..639ae6f398 100644 --- a/actionpack/lib/action_dispatch/testing/test_request.rb +++ b/actionpack/lib/action_dispatch/testing/test_request.rb @@ -12,7 +12,7 @@ module ActionDispatch def initialize(env = {}) env = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application - super(DEFAULT_ENV.merge(env)) + super(default_env.merge(env)) self.host = 'test.host' self.remote_addr = '0.0.0.0' @@ -69,5 +69,11 @@ module ActionDispatch def cookies @cookies ||= {}.with_indifferent_access end + + private + + def default_env + DEFAULT_ENV + end end end -- cgit v1.2.3