aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/filters_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-04-30 23:43:35 -0500
committerJoshua Peek <josh@joshpeek.com>2009-04-30 23:46:35 -0500
commit664ae187a927ba54c8c7ec6eaf9ad89be291fc95 (patch)
tree9ba0f1ed9e9fc1f490d6b35278ac376b886abf64 /actionpack/test/controller/filters_test.rb
parent05bd863c022601bb0bbd17c51adbcb420f349323 (diff)
downloadrails-664ae187a927ba54c8c7ec6eaf9ad89be291fc95.tar.gz
rails-664ae187a927ba54c8c7ec6eaf9ad89be291fc95.tar.bz2
rails-664ae187a927ba54c8c7ec6eaf9ad89be291fc95.zip
Update some old tests to use AC TestProcess
Diffstat (limited to 'actionpack/test/controller/filters_test.rb')
-rw-r--r--actionpack/test/controller/filters_test.rb25
1 files changed, 13 insertions, 12 deletions
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