diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 4c167ab99..038b2d59a 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -23,6 +23,7 @@ use WebGUI::AssetVersioning; use WebGUI::VersionTag; use Test::More; +use Test::Deep; use Test::MockObject; use HTML::TokeParser; @@ -143,7 +144,7 @@ $canViewMaker->prepare( }, ); -plan tests => 75 +plan tests => 80 + scalar(@fixIdTests) + scalar(@fixTitleTests) + 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle @@ -607,10 +608,55 @@ else { } +################################################################ +# +# isValidRssItem +# +################################################################ + +is($canViewAsset->isValidRssItem, 1, 'isValidRssItem: By default, all Assets are valid RSS items'); + +################################################################ +# +# getEditTabs +# +################################################################ + +is($canViewAsset->getEditTabs, undef, 'getEditTabs: No extra tabs by default'); + +################################################################ +# +# getEditForm +# +################################################################ + +$session->style->sent(0); ##Prevent extra output from being generated by session->style + ##At some point, a test will need to tie STDOUT and make sure + ##that the output is correct. +isa_ok($canViewAsset->getEditForm, 'WebGUI::TabForm', 'getEditForm: Returns a tabForm'); + +TODO: { + local $TODO = 'More getEditForm tests'; + ok(0, 'Validate form output'); +} + +################################################################ +# +# getNotFound +# +################################################################ + +my $origNotFoundPage = $session->setting->get('notFoundPage'); + +isa_ok(WebGUI::Asset->getNotFound($session), 'WebGUI::Asset', 'getNotFound: Returns an asset'); + +$session->setting->set('notFoundPage', $origNotFoundPage); + END: { - $session->config->set('extrasURL', $origExtras); - $session->config->set('uploadsURL', $origUploads); + $session->config->set( 'extrasURL', $origExtras); + $session->config->set( 'uploadsURL', $origUploads); $session->setting->set('urlExtension', $origUrlExtension); + $session->setting->set('notFoundPage', $origNotFoundPage); if (defined $origAssetAddPrivileges) { $session->config->set('assetAddPrivilege', $origAssetAddPrivileges); }