From 02399a1184d0f87b14af461fab731120d92c5ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 22 Jun 2010 07:57:02 +0200 Subject: Ensure overwritten callbacks conditions in controllers work [#4761 state:resolved] [#3913 state:resolved] --- actionpack/test/abstract/callbacks_test.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/actionpack/test/abstract/callbacks_test.rb b/actionpack/test/abstract/callbacks_test.rb index 0ce1dc506b..232a1679e0 100644 --- a/actionpack/test/abstract/callbacks_test.rb +++ b/actionpack/test/abstract/callbacks_test.rb @@ -47,8 +47,12 @@ module AbstractController end def index - self.response_body = @text - end + self.response_body = @text.to_s + end + end + + class Callback2Overwrite < Callback2 + before_filter :first, :except => :index end class TestCallbacks2 < ActiveSupport::TestCase @@ -70,6 +74,12 @@ module AbstractController @controller.process(:index) assert_equal "FIRSTSECOND", @controller.instance_variable_get("@aroundz") end + + test "before_filter with overwritten condition" do + @controller = Callback2Overwrite.new + result = @controller.process(:index) + assert_equal "", @controller.response_body + end end class Callback3 < ControllerWithCallbacks -- cgit v1.2.3