Permalink
Browse files

Ensure overwritten callbacks conditions in controllers work [#4761 st…

…ate:resolved] [#3913 state:resolved]
  • Loading branch information...
1 parent 1b369be commit 02399a1184d0f87b14af461fab731120d92c5ad8 @josevalim josevalim committed Jun 22, 2010
Showing with 12 additions and 2 deletions.
  1. +12 −2 actionpack/test/abstract/callbacks_test.rb
@@ -47,8 +47,12 @@ def aroundz
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 @@ def setup
@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

0 comments on commit 02399a1

Please sign in to comment.