diff options
author | Bogdan Gusiev <agresso@gmail.com> | 2012-09-07 14:42:31 +0300 |
---|---|---|
committer | Bogdan Gusiev <agresso@gmail.com> | 2012-09-07 14:42:31 +0300 |
commit | 6777f7b75d1d10ff148e3d72cef3ef642de5bda3 (patch) | |
tree | e9c074fc4a993978e8ba31ce4b47843f41b0549c /actionpack/test/controller | |
parent | e20a790b9e63ff7ff71753b24bd88c0a62dc2cf7 (diff) | |
download | rails-6777f7b75d1d10ff148e3d72cef3ef642de5bda3.tar.gz rails-6777f7b75d1d10ff148e3d72cef3ef642de5bda3.tar.bz2 rails-6777f7b75d1d10ff148e3d72cef3ef642de5bda3.zip |
AS::Callbacks: deprecate monkey patch of object callbacks
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index afc00a3c9d..d203601771 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -193,7 +193,7 @@ class FilterTest < ActionController::TestCase end class ConditionalClassFilter - def self.filter(controller) controller.instance_variable_set(:"@ran_class_filter", true) end + def self.before(controller) controller.instance_variable_set(:"@ran_class_filter", true) end end class OnlyConditionClassController < ConditionalFilterController @@ -309,7 +309,7 @@ class FilterTest < ActionController::TestCase end class AuditFilter - def self.filter(controller) + def self.before(controller) controller.instance_variable_set(:"@was_audited", true) end end @@ -449,7 +449,7 @@ class FilterTest < ActionController::TestCase class ErrorToRescue < Exception; end class RescuingAroundFilterWithBlock - def filter(controller) + def around(controller) begin yield rescue ErrorToRescue => ex @@ -894,7 +894,7 @@ end class ControllerWithFilterClass < PostsController class YieldingFilter < DefaultFilter - def self.filter(controller) + def self.around(controller) yield raise After end @@ -905,7 +905,7 @@ end class ControllerWithFilterInstance < PostsController class YieldingFilter < DefaultFilter - def filter(controller) + def around(controller) yield raise After end @@ -916,13 +916,13 @@ end class ControllerWithFilterMethod < PostsController class YieldingFilter < DefaultFilter - def filter(controller) + def around(controller) yield raise After end end - around_filter YieldingFilter.new.method(:filter), :only => :raises_after + around_filter YieldingFilter.new.method(:around), :only => :raises_after end class ControllerWithProcFilter < PostsController |