almost done fixing addRevision tests

This commit is contained in:
Doug Bell 2010-11-19 19:26:39 -06:00
parent 6931fd471e
commit 7c14d1e6c4
122 changed files with 389 additions and 1052 deletions

View file

@ -20,16 +20,12 @@ use WebGUI::Asset::Snippet;
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Shortcut Test"});
WebGUI::Test->addToCleanup($versionTag);
# Make a snippet to shortcut
my $snippet
= $node->addChild({
= WebGUI::Test->asset(
className => "WebGUI::Asset::Snippet",
});
);
#----------------------------------------------------------------------------
# Tests
@ -44,10 +40,10 @@ use_ok("WebGUI::Asset::Shortcut");
# Test creating a shortcut to snippet
# plan tests => 2
my $shortcut
= $node->addChild({
= WebGUI::Test->asset(
className => "WebGUI::Asset::Shortcut",
shortcutToAssetId => $snippet->getId,
});
);
isa_ok(
$shortcut, "WebGUI::Asset::Shortcut",

View file

@ -23,7 +23,6 @@ use WebGUI::Asset::Snippet;
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
my $node = WebGUI::Asset->getImportNode($session);
my $snippet;
my $shortcut;
@ -144,18 +143,15 @@ ok(
# init a new snippet and shortcut; handy to have in a sub because we destroy
# them in some tests and need to reset them for the next round
sub init {
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Shortcut Test"});
WebGUI::Test->addToCleanup($versionTag);
# Make a snippet to shortcut
$snippet
= $node->addChild({
= WebGUI::Test->asset(
className => "WebGUI::Asset::Snippet",
});
);
$shortcut
= $node->addChild({
= WebGUI::Test->asset(
className => "WebGUI::Asset::Shortcut",
shortcutToAssetId => $snippet->getId,
});
);
}

View file

@ -27,9 +27,6 @@ use WebGUI::Asset::Snippet;
my $session = WebGUI::Test->session;
my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Shortcut Test"});
WebGUI::Test->addToCleanup($versionTag);
# Make a snippet to shortcut
my $now = time();
my $snippet = $node->addChild({
@ -42,7 +39,6 @@ my $shortcut = $node->addChild({
shortcutToAssetId => $snippet->getId,
},
undef, $now-10);
$versionTag->commit;
$session->db->write(q|update assetData set lastModified=? where assetId=?|,[WebGUI::Test->webguiBirthday, $snippet->getId]);
foreach my $asset ($snippet, $shortcut) {
$asset = $asset->cloneFromDb;