Skip to content
Browse files

Deprecate Controller.process interface

  • Loading branch information...
1 parent f32cf44 commit 24affdc88c4a4af03ce1ec5b23c3def18b90effe @josh josh committed May 2, 2009
View
1 actionpack/lib/action_controller/base/base.rb
@@ -376,6 +376,7 @@ def call(env)
# Factory for the standard create, process loop where the controller is discarded after processing.
def process(request, response) #:nodoc:
+ ActiveSupport::Deprecation.warn("Controller.process has been deprecated. Use Controller.call instead", caller)
new.process(request, response)
end
View
2 actionpack/test/controller/filters_test.rb
@@ -603,7 +603,7 @@ def test_dynamic_dispatch
%w(foo bar baz).each do |action|
request = ActionController::TestRequest.new
request.query_parameters[:choose] = action
- response = DynamicDispatchController.process(request, ActionController::TestResponse.new)
+ response = Rack::MockResponse.new(*DynamicDispatchController.call(request.env))
assert_equal action, response.body
end
end
View
20 actionpack/test/controller/helper_test.rb
@@ -102,19 +102,19 @@ def test_helper_attr
end
def test_helper_for_nested_controller
- request = ActionController::TestRequest.new
- response = ActionController::TestResponse.new
+ request = ActionController::TestRequest.new
request.action = 'render_hello_world'
- assert_equal 'hello: Iz guuut!', Fun::GamesController.process(request, response).body
+ response = Rack::MockResponse.new(*Fun::GamesController.call(request.env))
+ assert_equal 'hello: Iz guuut!', response.body
end
def test_helper_for_acronym_controller
- request = ActionController::TestRequest.new
- response = ActionController::TestResponse.new
+ request = ActionController::TestRequest.new
request.action = 'test'
- assert_equal 'test: baz', Fun::PdfController.process(request, response).body
+ response = Rack::MockResponse.new(*Fun::PdfController.call(request.env))
+ assert_equal 'test: baz', response.body
end
def test_all_helpers
@@ -211,14 +211,16 @@ def setup
end
def test_helper_in_a
- assert_raise(ActionView::TemplateError) { A.process(@request, @response) }
+ assert_raise(ActionView::TemplateError) { A.call(@request.env) }
end
def test_helper_in_b
- assert_equal 'B', B.process(@request, @response).body
+ response = Rack::MockResponse.new(*B.call(@request.env))
+ assert_equal 'B', response.body
end
def test_helper_in_c
- assert_equal 'C', C.process(@request, @response).body
+ response = Rack::MockResponse.new(*C.call(@request.env))
+ assert_equal 'C', response.body
end
end

0 comments on commit 24affdc

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