From 664ae187a927ba54c8c7ec6eaf9ad89be291fc95 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 30 Apr 2009 23:43:35 -0500 Subject: Update some old tests to use AC TestProcess --- actionpack/test/controller/filters_test.rb | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index bdec5d2d4c..9e74538310 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -2,6 +2,8 @@ require 'abstract_unit' # FIXME: crashes Ruby 1.9 class FilterTest < Test::Unit::TestCase + include ActionController::TestProcess + class TestController < ActionController::Base before_filter :ensure_login after_filter :clean_up @@ -669,12 +671,11 @@ class FilterTest < Test::Unit::TestCase private def test_process(controller, action = "show") - ActionController::Base.class_eval { include ActionController::ProcessWithTest } unless ActionController::Base < ActionController::ProcessWithTest - request = ActionController::TestRequest.new - request.action = action - controller = controller.new if controller.is_a?(Class) - @controller = controller - @controller.process(request, ActionController::TestResponse.new) + @controller = controller.is_a?(Class) ? controller.new : controller + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + + process(action) end end @@ -810,6 +811,7 @@ end class YieldingAroundFiltersTest < Test::Unit::TestCase include PostsController::AroundExceptions + include ActionController::TestProcess def test_filters_registering assert_equal 1, ControllerWithFilterMethod.filter_chain.size @@ -912,11 +914,10 @@ class YieldingAroundFiltersTest < Test::Unit::TestCase protected def test_process(controller, action = "show") - ActionController::Base.class_eval { include ActionController::ProcessWithTest } unless ActionController::Base < ActionController::ProcessWithTest - request = ActionController::TestRequest.new - request.action = action - controller = controller.new if controller.is_a?(Class) - @controller = controller - @controller.process(request, ActionController::TestResponse.new) + @controller = controller.is_a?(Class) ? controller.new : controller + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + + process(action) end end -- cgit v1.2.3