diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-22 07:57:02 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-22 07:57:45 +0200 |
commit | 02399a1184d0f87b14af461fab731120d92c5ad8 (patch) | |
tree | c8a7603eabb64f15bac7f83500441e1b8b97579c /actionpack/test | |
parent | 1b369be02ffe52b9b278c41c762eedc35d52b348 (diff) | |
download | rails-02399a1184d0f87b14af461fab731120d92c5ad8.tar.gz rails-02399a1184d0f87b14af461fab731120d92c5ad8.tar.bz2 rails-02399a1184d0f87b14af461fab731120d92c5ad8.zip |
Ensure overwritten callbacks conditions in controllers work [#4761 state:resolved] [#3913 state:resolved]
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract/callbacks_test.rb | 14 |
1 files 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 |