Coverage tests for assetExists.
This commit is contained in:
parent
33c4cd833b
commit
fb54ca2a1c
1 changed files with 22 additions and 1 deletions
|
|
@ -143,7 +143,7 @@ $canViewMaker->prepare(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
plan tests => 71
|
plan tests => 75
|
||||||
+ scalar(@fixIdTests)
|
+ scalar(@fixIdTests)
|
||||||
+ scalar(@fixTitleTests)
|
+ scalar(@fixTitleTests)
|
||||||
+ 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle
|
+ 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle
|
||||||
|
|
@ -586,6 +586,27 @@ else {
|
||||||
$session->config->delete('assetUiLevel');
|
$session->config->delete('assetUiLevel');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
#
|
||||||
|
# assetExists
|
||||||
|
#
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
my $id = $canViewAsset->getId;
|
||||||
|
my $class = 'WebGUI::Asset';
|
||||||
|
my $date = $canViewAsset->get('revisionDate');
|
||||||
|
|
||||||
|
ok ( WebGUI::Asset->assetExists($session, $id, $class, $date), 'assetExists with proper class, id and revisionDate');
|
||||||
|
ok (!WebGUI::Asset->assetExists($session, $id, 'WebGUI::Asset::Snippet', $date), 'assetExists with wrong class does not exist');
|
||||||
|
my $id2 = $id;
|
||||||
|
++$id2;
|
||||||
|
ok (!WebGUI::Asset->assetExists($session, $id2, $class, $date), 'assetExists with wrong id does not exist');
|
||||||
|
ok (!WebGUI::Asset->assetExists($session, $id, $class, $date+1), 'assetExists with wrong revisionDate does not exist');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
END: {
|
END: {
|
||||||
$session->config->set('extrasURL', $origExtras);
|
$session->config->set('extrasURL', $origExtras);
|
||||||
$session->config->set('uploadsURL', $origUploads);
|
$session->config->set('uploadsURL', $origUploads);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue