提交 db23a95a 编写于 作者: N Neeraj Singh 提交者: José Valim

cache_sweeper yields blank output

[#3914 state:open]
Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 2500e6af
......@@ -57,6 +57,7 @@ class Sweeper < ActiveRecord::Observer #: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)
......
......@@ -24,6 +24,9 @@
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'
......
......@@ -445,6 +445,12 @@ def filter_three
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册