Add retry in case of problems in dispatch. Add tests for logging errors for bad templates.

This commit is contained in:
Colin Kuskie 2010-08-04 14:10:43 -07:00
parent 25fb019a18
commit 3a9a3dd8e9
2 changed files with 29 additions and 5 deletions

View file

@ -74,7 +74,7 @@ WebGUI::Test->addToCleanup( $tag );
#----------------------------------------------------------------------------
# Tests
plan tests => 13; # Increment this number for each test you create
plan tests => 16; # Increment this number for each test you create
#----------------------------------------------------------------------------
# Test dispatch
@ -125,4 +125,18 @@ $session->var->switchAdminOn;
$output = $td->dispatch();
is $output, 'www_view', 'when admin is on, the asset can be accessed';
$td->publish();
$session->var->switchAdminOff;
$output = $td->dispatch();
is $output, 'www_view', 'asset state restored for next tests';
# Test template exceptions
$session->request->setup_body( {
func => 'brokenTemplate',
} );
WebGUI::Test->interceptLogging;
is( $td->dispatch, "www_view", "if a query method throws a Template exception, view is returned instead" );
is $WebGUI::Test::logger_error, 'Template not found templateId: This is a GUID assetId: '. $td->getId, 'logged an error';
WebGUI::Test->restoreLogging;
#vim:ft=perl