diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-04-30 23:36:47 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-04-30 23:46:35 -0500 |
commit | 05bd863c022601bb0bbd17c51adbcb420f349323 (patch) | |
tree | 423b819e2dd55740501f2fb1d56d83ecdd3e0be1 | |
parent | 1fcc7dbcc8dcf7f1d42ca8486ad313f0c805033a (diff) | |
download | rails-05bd863c022601bb0bbd17c51adbcb420f349323.tar.gz rails-05bd863c022601bb0bbd17c51adbcb420f349323.tar.bz2 rails-05bd863c022601bb0bbd17c51adbcb420f349323.zip |
alias method chain process with test
-rw-r--r-- | actionpack/lib/action_controller/testing/process.rb | 9 | ||||
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb index 786dc67e2e..8315a160ad 100644 --- a/actionpack/lib/action_controller/testing/process.rb +++ b/actionpack/lib/action_controller/testing/process.rb @@ -132,7 +132,7 @@ module ActionController #:nodoc: build_request_uri(action, parameters) Base.class_eval { include ProcessWithTest } unless Base < ProcessWithTest - @controller.process_with_test(@request, @response) + @controller.process(@request, @response) end def xml_http_request(request_method, action, parameters = nil, session = nil, flash = nil) @@ -248,11 +248,14 @@ module ActionController #:nodoc: module ProcessWithTest #:nodoc: def self.included(base) - base.class_eval { attr_reader :assigns } + base.class_eval { + attr_reader :assigns + alias_method_chain :process, :test + } end def process_with_test(*args) - process(*args).tap { set_test_assigns } + process_without_test(*args).tap { set_test_assigns } end private diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index aca7a821c8..bdec5d2d4c 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -674,7 +674,7 @@ class FilterTest < Test::Unit::TestCase request.action = action controller = controller.new if controller.is_a?(Class) @controller = controller - @controller.process_with_test(request, ActionController::TestResponse.new) + @controller.process(request, ActionController::TestResponse.new) end end @@ -917,6 +917,6 @@ class YieldingAroundFiltersTest < Test::Unit::TestCase request.action = action controller = controller.new if controller.is_a?(Class) @controller = controller - @controller.process_with_test(request, ActionController::TestResponse.new) + @controller.process(request, ActionController::TestResponse.new) end end |