diff options
-rw-r--r-- | actionpack/lib/action_controller/caching/sweeping.rb | 1 | ||||
-rw-r--r-- | actionpack/test/abstract_unit.rb | 3 | ||||
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 6 |
3 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/caching/sweeping.rb b/actionpack/lib/action_controller/caching/sweeping.rb index cf16417e84..e9db0d97b6 100644 --- a/actionpack/lib/action_controller/caching/sweeping.rb +++ b/actionpack/lib/action_controller/caching/sweeping.rb @@ -57,6 +57,7 @@ module ActionController #:nodoc: def before(controller) self.controller = controller callback(:before) if controller.perform_caching + true # before method from sweeper should always return true end def after(controller) diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index d2e5d2e965..84c5395610 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -24,6 +24,9 @@ require 'action_view/testing/resolvers' require 'action_dispatch' require 'active_support/dependencies' require 'active_model' +require 'active_record' +require 'action_controller/caching' +require 'action_controller/caching/sweeping' begin require 'ruby-debug' diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index d5704eba78..25b78124e3 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -445,6 +445,12 @@ class FilterTest < ActionController::TestCase end + + def test_before_method_of_sweeper_should_always_return_true + sweeper = ActionController::Caching::Sweeper.send(:new) + assert sweeper.before(TestController.new) + end + def test_non_yielding_around_filters_not_returning_false_do_not_raise controller = NonYieldingAroundFilterController.new controller.instance_variable_set "@filter_return_value", true |