Namespace
- CLASS DispatcherTest::DummyApp
- CLASS DispatcherTest::Foo
Methods
Instance Public methods
setup()
Link
test_before_and_after_callbacks()
Link
# File actionpack/test/dispatch/callbacks_test.rb, line 19 def test_before_and_after_callbacks ActionDispatch::Callbacks.before { |*args| Foo.a += 1; Foo.b += 1 } ActionDispatch::Callbacks.after { |*args| Foo.a += 1; Foo.b += 1 } dispatch assert_equal 2, Foo.a assert_equal 2, Foo.b dispatch assert_equal 4, Foo.a assert_equal 4, Foo.b dispatch do raise "error" end rescue nil assert_equal 6, Foo.a assert_equal 6, Foo.b end
test_to_prepare_and_cleanup_delegation()
Link
# File actionpack/test/dispatch/callbacks_test.rb, line 38 def test_to_prepare_and_cleanup_delegation prepared = cleaned = false assert_deprecated do ActionDispatch::Callbacks.to_prepare { prepared = true } ActionDispatch::Callbacks.to_prepare { cleaned = true } end assert_deprecated do ActionDispatch::Reloader.prepare! end assert prepared assert_deprecated do ActionDispatch::Reloader.cleanup! end assert cleaned end