aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/callbacks_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-02-16 06:42:35 -0800
committerJosé Valim <jose.valim@plataformatec.com.br>2012-02-16 06:42:35 -0800
commitc53f6ca51b15b79dc785b45db8fa7cb1b85b05f3 (patch)
tree2d96cb6709b520ba9fd9d64094120b880913de50 /actionpack/test/dispatch/callbacks_test.rb
parenta5874dd118fb205f78e0becee44c4eac01127f8c (diff)
parentf1a3e7ba01418ab4219eb2cfce8bc1f5c60acbca (diff)
downloadrails-c53f6ca51b15b79dc785b45db8fa7cb1b85b05f3.tar.gz
rails-c53f6ca51b15b79dc785b45db8fa7cb1b85b05f3.tar.bz2
rails-c53f6ca51b15b79dc785b45db8fa7cb1b85b05f3.zip
Merge pull request #5062 from bogdan/test2
ActionDispatch: add missing test for callbacks
Diffstat (limited to 'actionpack/test/dispatch/callbacks_test.rb')
-rw-r--r--actionpack/test/dispatch/callbacks_test.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/test/dispatch/callbacks_test.rb b/actionpack/test/dispatch/callbacks_test.rb
index eed2eca2ab..f767b07e75 100644
--- a/actionpack/test/dispatch/callbacks_test.rb
+++ b/actionpack/test/dispatch/callbacks_test.rb
@@ -27,6 +27,12 @@ class DispatcherTest < ActiveSupport::TestCase
dispatch
assert_equal 4, Foo.a
assert_equal 4, Foo.b
+
+ dispatch do |env|
+ raise "error"
+ end rescue nil
+ assert_equal 6, Foo.a
+ assert_equal 6, Foo.b
end
def test_to_prepare_and_cleanup_delegation
@@ -44,8 +50,9 @@ class DispatcherTest < ActiveSupport::TestCase
private
def dispatch(&block)
- @dispatcher ||= ActionDispatch::Callbacks.new(block || DummyApp.new)
- @dispatcher.call({'rack.input' => StringIO.new('')})
+ ActionDispatch::Callbacks.new(block || DummyApp.new).call(
+ {'rack.input' => StringIO.new('')}
+ )
end
end