Make version tags mandatory again.

This commit is contained in:
Colin Kuskie 2011-10-25 19:44:58 -07:00
parent d0b3be1749
commit 4bfabb9469
94 changed files with 405 additions and 489 deletions

View file

@ -29,11 +29,14 @@ $SIG{HUP} = sub { use Carp; confess "hup"; };
# Init
my $session = WebGUI::Test->session;
my $tag = WebGUI::VersionTag->getWorking($session);
my $asset = WebGUI::Test->asset->addChild( {
className => 'WebGUI::Asset::Snippet',
url => 'example',
groupIdEdit => 3, # Admins
} );
$tag->commit;
$asset = $asset->cloneFromDb;
#----------------------------------------------------------------------------
# Check permissions

View file

@ -22,8 +22,6 @@ use WebGUI::Asset;
use WebGUI::AssetHelper::Copy;
use WebGUI::Test::Mechanize;
$SIG{HUP} = sub { use Carp; confess "hup"; };
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
@ -57,6 +55,7 @@ my $root = WebGUI::Asset->getRoot($session);
WebGUI::Test->addToCleanup( 'WebGUI::Fork' => $output->{forkId} );
}
ok(WebGUI::Test->waitForAllForks(10), "Forks finished");
$session->cache->clear;

View file

@ -39,25 +39,25 @@ my $output;
my $node = WebGUI::Asset->getImportNode($session);
my $root = WebGUI::Asset->getRoot( $session );
my $tag = WebGUI::VersionTag->getWorking( $session );
my %tag = ( tagId => $tag->getId, status => "pending" );
my $top = $node->addChild({
className => 'WebGUI::Asset::Wobject::Layout',
title => 'Top',
%tag,
} );
my $child = $top->addChild({
className => 'WebGUI::Asset::Wobject::Layout',
title => 'Child',
%tag,
});
my $grand = $child->addChild({
className => 'WebGUI::Asset::Snippet',
title => 'Grand',
%tag,
});
$tag->commit;
WebGUI::Test->addToCleanup( $tag );
foreach my $asset ($top, $child, $grand) {
$asset = $asset->cloneFromDb;
}
{
my $helper = WebGUI::AssetHelper::CopyBranch->new( id => 'copy_branch', session => $session, asset => $top );
$output = $helper->process;
@ -76,7 +76,7 @@ WebGUI::Test->addToCleanup( $tag );
my $mech = WebGUI::Test::Mechanize->new( config => WebGUI::Test->file );
$mech->get_ok( '/?op=assetHelper;helperId=copy_branch;method=copy;with=children;assetId=' . $top->getId );
WebGUI::Test->waitForAllForks;
WebGUI::Test->waitForAllForks(10);
my $clippies = $root->getLineage(["descendants"], {statesToInclude => [qw{clipboard clipboard-limbo}], returnObjects => 1,});
is @{ $clippies }, 2, '... copied 2 asset to the clipboard';
@ -85,7 +85,7 @@ for my $asset ( @$clippies ) {
}
$mech->get_ok( '/?op=assetHelper;helperId=copy_branch;method=copy;with=descendants;assetId=' . $top->getId );
WebGUI::Test->waitForAllForks;
WebGUI::Test->waitForAllForks(10);
my $clippies = $root->getLineage(["descendants"], {statesToInclude => [qw{clipboard clipboard-limbo}], returnObjects => 1,});
is @{ $clippies }, 3, '... copied 3 asset to the clipboard';
WebGUI::Test->addToCleanup( @$clippies );

View file

@ -48,9 +48,11 @@ cmp_deeply(
$session->setting->set( versionTagMode => 'autoCommit' );
$session->setting->set( skipCommitComments => '1' );
$session->user({userId => 3});
my $tag = WebGUI::VersionTag->getWorking($session);
my $safe_page = WebGUI::Test->asset;
my $helper = WebGUI::AssetHelper::CreateShortcut->new( id => 'shortcut', session => $session, asset => $safe_page );
$output = $helper->process;
$tag->commit;
cmp_deeply(
$output,
{

View file

@ -32,6 +32,7 @@ $session->user({ userId => 3 });
my $output;
my $node = WebGUI::Asset->getImportNode($session);
my $root = WebGUI::Asset->getRoot( $session );
my $tag = WebGUI::VersionTag->getWorking($session);
my $top = $node->addChild({
className => 'WebGUI::Asset::Wobject::Layout',
title => 'Top',
@ -52,6 +53,7 @@ my $grand = $child->addChild({
groupIdView => '7',
});
WebGUI::Test->addToCleanup( $top );
$tag->commit;
my $dir = File::Temp->newdir;
WebGUI::Test->originalConfig( "exportPath" );

View file

@ -36,12 +36,14 @@ $editor->addToGroups([4]);
WebGUI::Test->addToCleanup($editor);
$session->user({userId => 3});
my $tag = WebGUI::VersionTag->getWorking($session);
my $newPage = $home->addChild({
className => 'WebGUI::Asset::Wobject::Layout',
title => 'Test page',
groupIdEdit => '4',
ownerUserId => '3',
}, undef, WebGUI::Test->webguiBirthday, { skipAutoCommitWorkflows => 1, });
$tag->commit;
$newPage = WebGUI::Asset->newById($session, $newPage->assetId);

View file

@ -36,6 +36,7 @@ my $session = WebGUI::Test->session;
my $root = WebGUI::Test->asset;
my $class = 'WebGUI::Asset::Wobject::Shelf';
my $tag = WebGUI::VersionTag->getWorking($session);
my $shelf = $root->addChild({className => $class});
my $soda = [
@ -78,6 +79,8 @@ $shelf->addChild({
title => 'Shirts',
sku => 't-shirt',
});
$tag->commit;
my $helper = WebGUI::AssetHelper::Product::ExportCSV->new(
id => 'exportProducts',
session => $session,