Skip to content
This repository
Browse code

alias method chain process with test

  • Loading branch information...
commit 05bd863c022601bb0bbd17c51adbcb420f349323 1 parent 1fcc7db
Joshua Peek josh authored
9 actionpack/lib/action_controller/testing/process.rb
@@ -132,7 +132,7 @@ def process(action, parameters = nil, session = nil, flash = nil, http_method =
132 132 build_request_uri(action, parameters)
133 133
134 134 Base.class_eval { include ProcessWithTest } unless Base < ProcessWithTest
135   - @controller.process_with_test(@request, @response)
  135 + @controller.process(@request, @response)
136 136 end
137 137
138 138 def xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil)
@@ -248,11 +248,14 @@ def with_routing
248 248
249 249 module ProcessWithTest #:nodoc:
250 250 def self.included(base)
251   - base.class_eval { attr_reader :assigns }
  251 + base.class_eval {
  252 + attr_reader :assigns
  253 + alias_method_chain :process, :test
  254 + }
252 255 end
253 256
254 257 def process_with_test(*args)
255   - process(*args).tap { set_test_assigns }
  258 + process_without_test(*args).tap { set_test_assigns }
256 259 end
257 260
258 261 private
4 actionpack/test/controller/filters_test.rb
@@ -674,7 +674,7 @@ def test_process(controller, action = "show")
674 674 request.action = action
675 675 controller = controller.new if controller.is_a?(Class)
676 676 @controller = controller
677   - @controller.process_with_test(request, ActionController::TestResponse.new)
  677 + @controller.process(request, ActionController::TestResponse.new)
678 678 end
679 679 end
680 680
@@ -917,6 +917,6 @@ def test_process(controller, action = "show")
917 917 request.action = action
918 918 controller = controller.new if controller.is_a?(Class)
919 919 @controller = controller
920   - @controller.process_with_test(request, ActionController::TestResponse.new)
  920 + @controller.process(request, ActionController::TestResponse.new)
921 921 end
922 922 end

0 comments on commit 05bd863

Please sign in to comment.
Something went wrong with that request. Please try again.