diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/dispatcher_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/dispatcher_test.rb b/actionpack/test/controller/dispatcher_test.rb index 75b99c4d92..ec937ebfd2 100644 --- a/actionpack/test/controller/dispatcher_test.rb +++ b/actionpack/test/controller/dispatcher_test.rb @@ -96,6 +96,14 @@ class DispatcherTest < Test::Unit::TestCase assert_equal nil, b end + def test_to_prepare_only_runs_once_if_not_loading_dependencies + Dependencies.stubs(:load?).returns(false) + called = 0 + Dispatcher.to_prepare(:unprepared_test) { called += 1 } + 2.times { dispatch } + assert_equal 1, called + end + private def dispatch(output = @output) controller = mock |