Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…ate:resolved] [#3913 state:resolved]
  • Loading branch information...
commit 02399a1184d0f87b14af461fab731120d92c5ad8 1 parent 1b369be
@josevalim josevalim authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 actionpack/test/abstract/callbacks_test.rb
View
14 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
Please sign in to comment.
Something went wrong with that request. Please try again.