diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-12 10:53:00 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-12 10:53:00 -0700 |
commit | 72ca7c591c9eace150c0ebab1633d691a1ef12cf (patch) | |
tree | 5df30ffd42a00ef6ab38824bdee6e335e0b6d140 /actionpack/test | |
parent | 22c5667c2ef46d6723c1805d3adc52dc8e92429b (diff) | |
download | rails-72ca7c591c9eace150c0ebab1633d691a1ef12cf.tar.gz rails-72ca7c591c9eace150c0ebab1633d691a1ef12cf.tar.bz2 rails-72ca7c591c9eace150c0ebab1633d691a1ef12cf.zip |
Fixed new callbacks to not call the action when a callback sets the response body
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract_controller/callbacks_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/abstract_controller/callbacks_test.rb b/actionpack/test/abstract_controller/callbacks_test.rb index 410b1e57a6..1de60868c3 100644 --- a/actionpack/test/abstract_controller/callbacks_test.rb +++ b/actionpack/test/abstract_controller/callbacks_test.rb @@ -193,5 +193,24 @@ module AbstractController end end + class SetsResponseBody < ControllerWithCallbacks + before_filter :set_body + + def index + self.response_body = "Fail" + end + + def set_body + self.response_body = "Success" + end + end + + class TestHalting < ActiveSupport::TestCase + test "when a callback sets the response body, the action should not be invoked" do + result = SetsResponseBody.process(:index) + assert_equal "Success", result.response_body + end + end + end end
\ No newline at end of file |