Skip to content

Commit

Permalink
Ensure overwritten callbacks conditions in controllers work [#4761 st…
Browse files Browse the repository at this point in the history
…ate:resolved] [#3913 state:resolved]
  • Loading branch information
josevalim committed Jun 22, 2010
1 parent 1b369be commit 02399a1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions actionpack/test/abstract/callbacks_test.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 02399a1

Please sign in to comment.