Permalink
Browse files

group things that are alike

  • Loading branch information...
1 parent 9f4dafb commit 4f2cd3e9fee721d7485bb1c1b4151612d733da3a @tenderlove tenderlove committed Jul 4, 2012
Showing with 10 additions and 10 deletions.
  1. +3 −0 actionpack/lib/action_controller/metal/testing.rb
  2. +7 −10 actionpack/lib/action_controller/test_case.rb
@@ -17,6 +17,9 @@ def set_response!(request)
def recycle!
@_url_options = nil
+ self.response_body = nil
+ self.formats = nil
+ self.params = nil
end
end
@@ -467,11 +467,14 @@ def process(action, http_method = 'GET', *args)
# 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 @@ def process(action, http_method = 'GET', *args)
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 @@ def setup_controller_request_and_response
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.

0 comments on commit 4f2cd3e

Please sign in to comment.