diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 17:18:31 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 17:18:31 -0700 |
commit | 4f2cd3e9fee721d7485bb1c1b4151612d733da3a (patch) | |
tree | 6574ee59bddb0c5aaaa11715dd9236f3304a7b88 /actionpack | |
parent | 9f4dafb8ef2a7c8c409d5f0a7d2f2fca8215c992 (diff) | |
download | rails-4f2cd3e9fee721d7485bb1c1b4151612d733da3a.tar.gz rails-4f2cd3e9fee721d7485bb1c1b4151612d733da3a.tar.bz2 rails-4f2cd3e9fee721d7485bb1c1b4151612d733da3a.zip |
group things that are alike
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/metal/testing.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 17 |
2 files changed, 10 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/metal/testing.rb b/actionpack/lib/action_controller/metal/testing.rb index 09581d4fc9..0377b8c4cf 100644 --- a/actionpack/lib/action_controller/metal/testing.rb +++ b/actionpack/lib/action_controller/metal/testing.rb @@ -17,6 +17,9 @@ module ActionController def recycle! @_url_options = nil + self.response_body = nil + self.formats = nil + self.params = nil end end diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 210ae98f8d..ce2cd9e61c 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -467,11 +467,14 @@ module ActionController # proper params, as is the case when engaging rack. parameters = paramify_values(parameters) if html_format?(parameters) + unless @controller.respond_to?(:recycle!) + @controller.extend(Testing::Functional) + @controller.class.class_eval { include Testing } + end + @request.recycle! @response.recycle! - @controller.response_body = nil - @controller.formats = nil - @controller.params = nil + @controller.recycle! @html_document = nil @request.env['REQUEST_METHOD'] = http_method @@ -492,12 +495,6 @@ module ActionController build_request_uri(action, parameters) - unless @controller.respond_to?(:recycle!) - @controller.extend(Testing::Functional) - @controller.class.class_eval { include Testing } - end - - @controller.recycle! name = @request.parameters[:action] @controller.process(name) @@ -535,7 +532,7 @@ module ActionController setup :setup_controller_request_and_response end - private + private def check_required_ivars # Sanity check for required instance variables so we can give an # understandable error message. |