From f1a3e7ba01418ab4219eb2cfce8bc1f5c60acbca Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Thu, 16 Feb 2012 15:58:58 +0200 Subject: ActionDispatch: add missing test for callbacks --- actionpack/test/dispatch/callbacks_test.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'actionpack/test/dispatch/callbacks_test.rb') 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 -- cgit v1.2.3