diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 17:29:46 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 17:29:46 -0700 |
commit | 5ee27630f79588f9e97c4bd1c55184b9f3616d25 (patch) | |
tree | 8a85675b39c9b4f8033a473f3192c46420c45a99 | |
parent | 4f2cd3e9fee721d7485bb1c1b4151612d733da3a (diff) | |
download | rails-5ee27630f79588f9e97c4bd1c55184b9f3616d25.tar.gz rails-5ee27630f79588f9e97c4bd1c55184b9f3616d25.tar.bz2 rails-5ee27630f79588f9e97c4bd1c55184b9f3616d25.zip |
assing the request on the response only once
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index ce2cd9e61c..2ac9ce2877 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -467,6 +467,8 @@ module ActionController # proper params, as is the case when engaging rack. parameters = paramify_values(parameters) if html_format?(parameters) + @html_document = nil + unless @controller.respond_to?(:recycle!) @controller.extend(Testing::Functional) @controller.class.class_eval { include Testing } @@ -476,7 +478,6 @@ module ActionController @response.recycle! @controller.recycle! - @html_document = nil @request.env['REQUEST_METHOD'] = http_method parameters ||= {} @@ -489,7 +490,6 @@ module ActionController @request.session.update(session) if session @request.session["flash"] = @request.flash.update(flash || {}) - @response.request = @request @controller.request = @request @controller.response = @response @@ -510,8 +510,9 @@ module ActionController end def setup_controller_request_and_response - @request = TestRequest.new - @response = TestResponse.new + @request = TestRequest.new + @response = TestResponse.new + @response.request = @request if klass = self.class.controller_class @controller ||= klass.new rescue nil |