aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorBogdan Gusiev <agresso@gmail.com>2012-02-16 15:58:58 +0200
committerBogdan Gusiev <agresso@gmail.com>2012-02-16 15:58:58 +0200
commitf1a3e7ba01418ab4219eb2cfce8bc1f5c60acbca (patch)
tree2d96cb6709b520ba9fd9d64094120b880913de50 /actionpack/test
parenta5874dd118fb205f78e0becee44c4eac01127f8c (diff)
downloadrails-f1a3e7ba01418ab4219eb2cfce8bc1f5c60acbca.tar.gz
rails-f1a3e7ba01418ab4219eb2cfce8bc1f5c60acbca.tar.bz2
rails-f1a3e7ba01418ab4219eb2cfce8bc1f5c60acbca.zip
ActionDispatch: add missing test for callbacks
Diffstat (limited to 'actionpack/test')
-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