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

@ -121,7 +121,6 @@ my $endDt = $startDt->clone->add(days => 2);
my $windowEnd = $endDt->clone->subtract(seconds => 1);
my $tag2 = WebGUI::VersionTag->getWorking($session);
my %tag = ( tagId => $tag2->getId, status => "pending" );
my $inside = $windowCal->addChild({
className => 'WebGUI::Asset::Event',
@ -129,7 +128,6 @@ my $inside = $windowCal->addChild({
startDate => $bday->toDatabaseDate,
endDate => $bday->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $insidewt = $windowCal->addChild({
@ -140,7 +138,6 @@ my $insidewt = $windowCal->addChild({
startTime => $bday->toDatabaseTime,
endTime => $bday->clone->add(hours => 1)->toDatabaseTime,
timeZone => $tz,
%tag,
},);
my $outsideHigh = $windowCal->addChild({
@ -149,7 +146,6 @@ my $outsideHigh = $windowCal->addChild({
startDate => $endDt->clone->add(days => 2)->toDatabaseDate,
endDate => $endDt->clone->add(days => 3)->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $outsideLow = $windowCal->addChild({
@ -158,7 +154,6 @@ my $outsideLow = $windowCal->addChild({
startDate => $startDt->clone->subtract(days => 3)->toDatabaseDate,
endDate => $startDt->clone->subtract(days => 2)->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $straddle = $windowCal->addChild({
@ -167,7 +162,6 @@ my $straddle = $windowCal->addChild({
startDate => $startDt->clone->subtract(days => 1)->toDatabaseDate,
endDate => $endDt->clone->add(days => 1)->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $straddlewt = $windowCal->addChild({
@ -178,7 +172,6 @@ my $straddlewt = $windowCal->addChild({
startTime => $startDt->clone->subtract(hours => 12)->toDatabaseTime,
endTime => $endDt->clone->add(hours => 12)->toDatabaseTime,
timeZone => $tz,
%tag,
},);
my $straddleLowwt = $windowCal->addChild({
@ -189,7 +182,6 @@ my $straddleLowwt = $windowCal->addChild({
startTime => $startDt->clone->subtract(hours => 12)->toDatabaseTime,
endTime => $startDt->clone->add(hours => 12)->toDatabaseTime,
timeZone => $tz,
%tag,
},);
my $straddleHighwt = $windowCal->addChild({
@ -200,7 +192,6 @@ my $straddleHighwt = $windowCal->addChild({
startTime => $endDt->clone->subtract(hours => 12)->toDatabaseTime,
endTime => $endDt->clone->add(hours => 12)->toDatabaseTime,
timeZone => $tz,
%tag,
},);
my $justBeforewt = $windowCal->addChild({
@ -211,7 +202,6 @@ my $justBeforewt = $windowCal->addChild({
startTime => $startDt->clone->subtract(hours => 1)->toDatabaseTime,
endTime => $startDt->toDatabaseTime,
timeZone => $tz,
%tag,
},);
my $justAfterwt = $windowCal->addChild({
@ -222,7 +212,6 @@ my $justAfterwt = $windowCal->addChild({
startTime => $endDt->toDatabaseTime,
endTime => $endDt->clone->add(hours => 1)->toDatabaseTime,
timeZone => $tz,
%tag,
}, );
my $justBefore = $windowCal->addChild({
@ -231,7 +220,6 @@ my $justBefore = $windowCal->addChild({
startDate => $startDt->clone->add(days => -1)->toDatabaseDate,
endDate => $startDt->clone->add(days => -1)->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $justAfter = $windowCal->addChild({
@ -240,7 +228,6 @@ my $justAfter = $windowCal->addChild({
startDate => $endDt->clone->add(days => 1)->toDatabaseDate,
endDate => $endDt->clone->add(days => 1)->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $starting = $windowCal->addChild({
@ -249,7 +236,6 @@ my $starting = $windowCal->addChild({
startDate => $startDt->toDatabaseDate,
endDate => $startDt->toDatabaseDate,
timeZone => $tz,
%tag,
}, );
my $ending = $windowCal->addChild({
@ -258,7 +244,6 @@ my $ending = $windowCal->addChild({
startDate => $endDt->clone->add(days => -1)->toDatabaseDate,
endDate => $endDt->clone->add(days => -1)->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $coincident = $windowCal->addChild({
@ -267,7 +252,6 @@ my $coincident = $windowCal->addChild({
startDate => $startDt->toDatabaseDate,
endDate => $endDt->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $coincidentLow = $windowCal->addChild({
@ -276,7 +260,6 @@ my $coincidentLow = $windowCal->addChild({
startDate => $startDt->toDatabaseDate,
endDate => $endDt->clone->add(days => 1)->toDatabaseDate,
timeZone => $tz,
%tag,
},);
my $coincidentHigh = $windowCal->addChild({
@ -285,7 +268,6 @@ my $coincidentHigh = $windowCal->addChild({
startDate => $startDt->clone->add( days => -1, )->toDatabaseDate,
endDate => $endDt->toDatabaseDate,
timeZone => $tz,
%tag,
},);
# no suffix = all day event

View file

@ -34,10 +34,9 @@ my $node = WebGUI::Test->asset;
my $versionTag = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->addToCleanup($versionTag);
$versionTag->set({name => 'Collaboration => groupToEditPost test'});
my %tag = ( tagId => $versionTag->getId, status => "pending" );
# place the collab system under a layout to ensure we're using the inherited groupIdEdit value
my $layout = $node->addChild({className => 'WebGUI::Asset::Wobject::Layout', %tag});
my $layout = $node->addChild({className => 'WebGUI::Asset::Wobject::Layout', });
# set the layout as the current asset for the same reason
$session->asset($layout);
@ -46,7 +45,6 @@ $session->asset($layout);
my $collab = $layout->addChild({
className => 'WebGUI::Asset::Wobject::Collaboration',
url => 'collab',
%tag,
});
$versionTag->commit;
@ -68,8 +66,6 @@ my $tag1 = WebGUI::VersionTag->getWorking($session);
my $props = {
className => 'WebGUI::Asset::Post::Thread',
content => 'hello, world!',
status => "pending",
tagId => $tag1->getId,
};
my $thread = $collab->addChild($props, @addChildCoda);
$thread->setSkipNotification;
@ -83,8 +79,6 @@ my $tag2 = WebGUI::VersionTag->getWorking($session);
$props = {
className => 'WebGUI::Asset::Post::Thread',
content => 'jello, world!',
status => "pending",
tagId => $tag2->getId,
};
my $thread2 = $collab->addChild($props, @addChildCoda);
$thread2->setSkipNotification;

View file

@ -19,9 +19,12 @@ use Test::Deep;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
my $addArgs = { skipNotifications => 1, skipAutoCommitWorkflows => 1, };
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
my $tag = WebGUI::VersionTag->getWorking($session);
my $collab = WebGUI::Test->asset->addChild({
className => 'WebGUI::Asset::Wobject::Collaboration',
threadsPerPage => 20,
@ -33,28 +36,34 @@ my @threads = (
title => "X - Foo",
isSticky => 0,
threadRating => 4,
}, undef, 1, ),
}, undef, 1, $addArgs ),
$collab->addChild( {
className => 'WebGUI::Asset::Post::Thread',
title => "W - Bar",
isSticky => 0,
threadRating => 2,
}, undef, 2, ),
}, undef, 2, $addArgs ),
$collab->addChild( {
className => 'WebGUI::Asset::Post::Thread',
title => "Z - Baz",
isSticky => 1,
threadRating => 6,
}, undef, 3, ),
}, undef, 3, $addArgs ),
$collab->addChild( {
className => 'WebGUI::Asset::Post::Thread',
title => "Y - Shank",
isSticky => 1,
threadRating => 5,
}, undef, 4, ),
}, undef, 4, $addArgs ),
);
$_->setSkipNotification for @threads; # 100+ messages later...
$tag->commit;
foreach my $asset ($collab, @threads) {
$asset = $asset->cloneFromDb;
}
#----------------------------------------------------------------------------
# Tests

View file

@ -31,6 +31,8 @@ $user{"2"} = WebGUI::User->new( $session, "new" );
$user{"2"}->addToGroups( ['2'] ); # Registered user
WebGUI::Test->addToCleanup($user{'2'});
my $tag = WebGUI::VersionTag->getWorking($session);
my $collab
= $node->addChild({
className => "WebGUI::Asset::Wobject::Collaboration",
@ -41,6 +43,9 @@ my $collab
canStartThreadGroupId => 3, # Admin
},);
$tag->commit;
$collab = $collab->cloneFromDb;
#----------------------------------------------------------------------------
# Tests
plan tests => 36;

View file

@ -20,6 +20,8 @@ use Test::Deep;
use Data::Dumper;
use WebGUI::Session;
my $addArgs = { skipNotifications => 1, skipAutoCommitWorkflows => 1, };
#----------------------------------------------------------------------------
# Tests
plan tests => 23; # Increment this number for each test you create
@ -27,6 +29,7 @@ plan tests => 23; # Increment this number for each test you create
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
my $tag = WebGUI::VersionTag->getWorking($session);
my $collab = WebGUI::Test->asset->addChild({
className => 'WebGUI::Asset::Wobject::Collaboration',
threadsPerPage => 20,
@ -39,18 +42,23 @@ my @threads = (
title => "X - Foo",
isSticky => 0,
ownerUserId => 1,
}, undef, 1,),
}, undef, 1, $addArgs ),
$collab->addChild( {
className => 'WebGUI::Asset::Post::Thread',
title => "X - Bar",
isSticky => 0,
ownerUserId => 3,
}, undef, 2,),
}, undef, 2, $addArgs ),
);
for my $t ( @threads ) {
$t->setSkipNotification;
$t->commit;
}
$tag->commit;
foreach my $asset ($collab, @threads) {
$asset = $asset->cloneFromDb;
}
my $templateVars;
@ -104,9 +112,7 @@ foreach my $index (1 .. 5) {
title => "X - Bar",
isSticky => 0,
ownerUserId => 3,
tagId => $vt2->getId,
status => "pending",
}, undef, 2+$index);
}, undef, 2+$index, $addArgs );
$newThreads[$index]->setSkipNotification;
}
$vt2->commit;

View file

@ -28,6 +28,7 @@ use WebGUI::Session;
my $session = WebGUI::Test->session;
# Create a DataForm
my $tag = WebGUI::VersionTag->getWorking($session);
my $df = WebGUI::Test->asset
->addChild( {
className => "WebGUI::Asset::Wobject::DataForm",
@ -40,6 +41,9 @@ my $dform = WebGUI::Test->asset->addChild({
mailData => 0,
}, undef, time-5);
$dform->createField('gotCaptcha', { type => 'Captcha', name => 'humanCheck', });
$tag->commit;
$df = $df->cloneFromDb;
$dform = $dform->cloneFromDb;
#----------------------------------------------------------------------------
# Tests

View file

@ -45,21 +45,6 @@ my $node = WebGUI::Test->asset;
# Create a version tag to work in
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"EventManagementSystem Test"});
my %tag = ( tagId => $versionTag->getId, status => "pending" );
#----------------------------------------------------------------------------
# Tests
plan tests => 70; # Increment this number for each test you create
#----------------------------------------------------------------------------
# check base module and all related
use_ok('WebGUI::Asset::Wobject::EventManagementSystem');
use_ok('WebGUI::Asset::Sku::EMSBadge');
use_ok('WebGUI::Asset::Sku::EMSTicket');
use_ok('WebGUI::Asset::Sku::EMSRibbon');
use_ok('WebGUI::Asset::Sku::EMSToken');
# Add an EMS asset
my $ems = $node->addChild({
@ -70,10 +55,10 @@ my $ems = $node->addChild({
workflowIdCommit => 'pbworkflow000000000003', # Commit Content Immediately
registrationStaffGroupId => $registrars->getId,
groupIdView => $attendees->getId,
%tag
});
$versionTag->commit;
WebGUI::Test->addToCleanup($versionTag);
$ems = $ems->cloneFromDb;
# Test for a sane object type
isa_ok($ems, 'WebGUI::Asset::Wobject::EventManagementSystem');
@ -634,10 +619,13 @@ cmp_deeply( JSON::from_json($data), {
#----------------------------------------------------------------------------
# www_editBadgeGroup
my $ems_tag = WebGUI::VersionTag->getWorking($session);
$ems = WebGUI::Test->asset(
className => 'WebGUI::Asset::Wobject::EventManagementSystem',
groupIdEdit => '3',
);
$ems_tag->commit;
$ems = $ems->cloneFromDb;
my $mech = WebGUI::Test::Mechanize->new( config => WebGUI::Test->file );
$mech->get_ok('/');
@ -801,10 +789,13 @@ $mech->get_ok('/');
$mech->session->user({ userId => 3 });
# Need a badge
my $badger_tag = WebGUI::VersionTag->getWorking($session);
my $badger = $ems->addChild({
className => 'WebGUI::Asset::Sku::EMSBadge',
title => 'Badgers',
});
$badger_tag->commit;
$badger = $badger->cloneFromDb;
# Add cart and complete checkout
my $regBadgeId
= $session->db->setRow( 'EMSRegistrant', 'badgeId', {
@ -838,3 +829,4 @@ cmp_deeply(
"Registrant info saved correctly",
);
done_testing;

View file

@ -32,14 +32,12 @@ my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set( { name=>"Gallery Search Test" } );
my %tag = ( tagId => $versionTag->getId, status => "pending" );
WebGUI::Test->addToCleanup( $versionTag );
# Create gallery and a single album
my $gallery
= $node->addChild({
className => "WebGUI::Asset::Wobject::Gallery",
%tag,
});
my $album
@ -48,7 +46,6 @@ my $album
title => "album",
synopsis => "synopsis2",
keywords => "group2",
%tag,
});
my $albumId = $album->getId;
@ -60,7 +57,6 @@ my $photo1
synopsis => "synopsis1",
keywords => "group1",
location => "Heidelberg",
%tag,
});
my $id1 = $photo1->getId;
@ -71,7 +67,6 @@ my $photo2
synopsis => "synopsis2",
keywords => "group1",
location => "Mannheim",
%tag,
});
my $id2 = $photo2->getId;
@ -82,7 +77,6 @@ my $photo3
synopsis => "synopsis1",
keywords => "group2",
location => "Mannheim",
%tag,
});
my $id3 = $photo3->getId;

View file

@ -23,7 +23,6 @@ use Test::Deep;
my $session = WebGUI::Test->session;
my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
my %tag = ( tagId => $versionTag->getId, status => "pending" );
$versionTag->set({name=>"Add Archive to Album Test"});
WebGUI::Test->addToCleanup($versionTag);
@ -35,14 +34,12 @@ my $gallery
groupIdView => 7, # Everyone
groupIdEdit => 3, # Admins
ownerUserId => 3, # Admin
%tag,
});
my $album
= $gallery->addChild({
className => "WebGUI::Asset::Wobject::GalleryAlbum",
ownerUserId => "3", # Admin
%tag,
});
$versionTag->commit;
@ -63,8 +60,6 @@ my $properties = {
keywords => "something",
location => "somewhere",
friendsOnly => "1",
tagId => $versionTag->getId,
status => "pending",
};
$album->addArchive( WebGUI::Test->getTestCollateralPath('elephant_images.zip'), $properties );
@ -128,7 +123,6 @@ $versionTag->rollback;
# it's machine dependent.
$versionTag = WebGUI::VersionTag->getWorking($session);
$properties->{tagId} = $versionTag->getId;
# Add photos sorted by file order (default)
$album->addArchive( WebGUI::Test->getTestCollateralPath('gallery_archive_sorting_test.zip'), $properties, 'fileOrder' );
# Get all children
@ -143,7 +137,6 @@ cmp_deeply(
$versionTag->rollback;
$versionTag = WebGUI::VersionTag->getWorking($session);
$properties->{tagId} = $versionTag->getId;
# Add photos sorted by date
$album->addArchive( WebGUI::Test->getTestCollateralPath('gallery_archive_sorting_test.zip'), $properties, 'date' );
# Get all children
@ -158,7 +151,6 @@ cmp_deeply(
$versionTag->rollback;
$versionTag = WebGUI::VersionTag->getWorking($session);
$properties->{tagId} = $versionTag->getId;
# Add photos sorted by name
$album->addArchive( WebGUI::Test->getTestCollateralPath('gallery_archive_sorting_test.zip'), $properties, 'name' );
# Get all children

View file

@ -22,6 +22,7 @@ my $session = WebGUI::Test->session;
my $node = WebGUI::Test->asset;
# Create gallery and a single album
my $tag = WebGUI::VersionTag->getWorking($session);
my $gallery
= $node->addChild({
className => "WebGUI::Asset::Wobject::Gallery",
@ -38,16 +39,13 @@ for (my $i = 0; $i < 5; $i++)
$photo[$i]
= $album->addChild({
className => "WebGUI::Asset::File::GalleryFile::Photo",
});
}, undef, undef, { skipNotifications => 1, skipAutoCommitWorkflows => 1, });
}
#----------------------------------------------------------------------------
# Tests
plan tests => 15;
#----------------------------------------------------------------------------
# Test module compiles okay
use_ok("WebGUI::Asset::Wobject::GalleryAlbum");
$tag->commit;
foreach my $asset ($gallery, $album, @photo) {
$asset = $asset->cloneFromDb;
}
#----------------------------------------------------------------------------
# Test getPreviousFileId
@ -75,4 +73,6 @@ is( $album->getNextFileId(''), undef, 'Return undef if empty string specified');
is( $album->getNextFileId('123456'), undef, 'Return undef if non-existing id specified');
is( $album->getNextFileId($album->getId), undef, 'Return undef if non-child id specified');
done_testing;
#vim:ft=perl

View file

@ -26,7 +26,6 @@ my $session = WebGUI::Test->session;
my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->addToCleanup($versionTag);
my %tag = ( tagId => $versionTag->getId, status => "pending" );
$versionTag->set({name=>"Album Test"});
my $gallery
= $node->addChild({
@ -36,13 +35,11 @@ my $gallery
groupIdView => 2, # Registered Users
groupIdEdit => 3, # Admins
ownerUserId => 3, # Admin
%tag,
});
my $album
= $gallery->addChild({
className => "WebGUI::Asset::Wobject::GalleryAlbum",
ownerUserId => "3", # Admin
%tag,
});
my @photos;
for my $i ( 0 .. 5 ) {
@ -50,7 +47,6 @@ for my $i ( 0 .. 5 ) {
= $album->addChild({
className => "WebGUI::Asset::File::GalleryFile::Photo",
filename => "$i.jpg",
%tag,
});
}

View file

@ -18,7 +18,7 @@ use WebGUI::Test;
use WebGUI::Test::MockAsset;
use WebGUI::Test::Mechanize;
use WebGUI::Session;
use Test::More tests => 27; # increment this value for each test you create
use Test::More; # increment this value for each test you create
use Test::Deep;
use Data::Dumper;
@ -45,9 +45,12 @@ foreach my $name (@names) {
}
WebGUI::Test->addToCleanup(@users);
my $tag = WebGUI::VersionTag->getWorking($session);
my $board = WebGUI::Test->asset(
className => 'WebGUI::Asset::Wobject::InOutBoard',
);
$tag->commit;
$board = $board->cloneFromDb;
$board->prepareView();
@ -176,10 +179,13 @@ is ($count, 0, '... cleans up statusLog table');
#----------------------------------------------------------------------------
# selectDelegates
my $tag2 = WebGUI::VersionTag->getWorking($session);
$board = WebGUI::Test->asset(
className => 'WebGUI::Asset::Wobject::InOutBoard',
inOutGroup => '7', # everyone
);
$tag2->commit;
$board = $board->cloneFromDb;
my $mech = WebGUI::Test::Mechanize->new( config => WebGUI::Test->file );
$mech->get_ok( '/' );
@ -238,3 +244,5 @@ $mech->submit_form_ok( {
# Report was ok!
$mech->content_lacks( "No sleep till Brooklyn!" );
$mech->content_contains( "Sleeping till Brooklyn!" );
done_testing;

View file

@ -15,7 +15,7 @@ use File::Spec;
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 30; # increment this value for each test you create
use Test::More; # increment this value for each test you create
use Test::Deep;
use JSON;
use WebGUI::Asset::Wobject::Matrix;
@ -26,10 +26,11 @@ my $session = WebGUI::Test->session;
my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
my %tag = ( tagId => $versionTag->getId, status => "pending" );
$versionTag->set({name=>"Matrix Test"});
WebGUI::Test->addToCleanup($versionTag);
my $matrix = $node->addChild({className=>'WebGUI::Asset::Wobject::Matrix',%tag});
my $matrix = $node->addChild({className=>'WebGUI::Asset::Wobject::Matrix'});
$versionTag->commit;
$matrix = $matrix->cloneFromDb;
# Test for a sane object type
isa_ok($matrix, 'WebGUI::Asset::Wobject::Matrix');
@ -103,7 +104,10 @@ is($newAttribute->{attributeId},undef,"The new attribute was successfully delete
# add a listing
my $listing_tag = WebGUI::VersionTag->getWorking($session);
my $matrixListing = $matrix->addChild({className=>'WebGUI::Asset::MatrixListing'}, undef, undef, { skipNotification => 1});
$listing_tag->commit;
$matrixListing = $matrixListing->cloneFromDb;
WebGUI::Test->addToCleanup($matrixListing);
@ -441,3 +445,5 @@ cmp_deeply(
},
'statistics calculated for the category with 10 ratings'
);
done_testing;

View file

@ -26,10 +26,13 @@ use WebGUI::Session;
# Init
my $session = WebGUI::Test->session;
my $tag = WebGUI::VersionTag->getWorking($session);
my $pm = WebGUI::Test->asset(
className => 'WebGUI::Asset::Wobject::ProjectManager',
groupToAdd => 3,
);
$tag->commit;
$pm = $pm->cloneFromDb;
#----------------------------------------------------------------------------
# Tests

View file

@ -27,9 +27,10 @@ my $node = WebGUI::Asset->getDefault($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Search Test"});
my %tag = ( tagId => $versionTag->getId, status => "pending" );
WebGUI::Test->addToCleanup($versionTag);
my $search = $node->addChild({className=>'WebGUI::Asset::Wobject::Search', %tag});
my $search = $node->addChild({className=>'WebGUI::Asset::Wobject::Search'});
$versionTag->commit;
$search = $search->cloneFromDb;
# Test for a sane object type
isa_ok($search, 'WebGUI::Asset::Wobject::Search');
@ -89,14 +90,12 @@ $search->update({
{
my $versionTag2 = WebGUI::VersionTag->getWorking($session);
$tag{tagId} = $versionTag2->getId;
$versionTag2->set({name=>"Collab setup"});
my @addArgs = ( undef, undef, { skipNotification => 1 } );
my @addArgs = ( undef, undef, { skipNotification => 1, skipAutoCommitWorkflows => 1, } );
my $collab = $node->addChild({
className => 'WebGUI::Asset::Wobject::Collaboration',
editTimeout => '1',
threadsPerPage => 3,
%tag,
},
@addArgs);
# finally, add the post to the collaboration system
@ -104,7 +103,6 @@ $search->update({
className => 'WebGUI::Asset::Post::Thread',
content => 'verbosity shale anything',
ownerUserId => 1,
%tag,
};
my $thread = $collab->addChild($props, @addArgs);
@ -132,12 +130,10 @@ $search->update({
# Test useContainers when the user cannot view the container
my $versionTag3 = WebGUI::VersionTag->getWorking($session);
$versionTag3->set({name=>"Folder setup"});
$tag{tagId} = $versionTag3->getId;
my @addArgs = ( undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 } );
my $folder = $node->addChild({
className => 'WebGUI::Asset::Wobject::Folder',
groupIdView => '3', # Admins
%tag,
},
@addArgs);
# add an article anyone can see
@ -145,8 +141,6 @@ $search->update({
className => 'WebGUI::Asset::Wobject::Article',
synopsis => 'juxtaposition coolwhip cheezewhiz',
groupIdView => '7', # Everyone
tagId => $versionTag3->getId,
status => 'pending',
};
my $snippet = $folder->addChild($props, @addArgs);
@ -161,7 +155,6 @@ $search->update({
$search->prepareView;
$search->view;
$search->update({useContainers => 0});
note( explain $templateVars );
is $templateVars->{result_set}->[0]->{url}, $snippet->get('url'), 'search returns regular URL for article';
$search->update({useContainers => 1});
$search->view;

View file

@ -27,30 +27,25 @@ my $node = WebGUI::Asset->getImportNode($session);
my $tag2 = WebGUI::VersionTag->getWorking($session);
my %tag = ( tagId => $tag2->getId, status => "pending" );
my $default = WebGUI::Asset->getDefault($session);
my $importArticle = $node->addChild({
className => 'WebGUI::Asset::Wobject::Article',
description => 'rockhound',
%tag,
});
my $defaultArticle = $default->addChild({
className => 'WebGUI::Asset::Wobject::Article',
description => 'rockhound',
%tag,
});
my $template = $node->addChild({
className => 'WebGUI::Asset::Template',
parser => 'WebGUI::Asset::Template::HTMLTemplate',
template => qq{[<tmpl_loop result_set>"<tmpl_var assetId>"<tmpl_unless __LAST__>,</tmpl_unless></tmpl_loop>]},
%tag,
});
my $search = $default->addChild({
className => 'WebGUI::Asset::Wobject::Search',
searchRoot => $default->getId,
templateId => $template->getId,
%tag,
});
$tag2->commit;

View file

@ -74,13 +74,11 @@ my @skipAutoCommit = WebGUI::Test->getAssetSkipCoda;
my $home = WebGUI::Test->asset;
$versionTag = WebGUI::VersionTag->getWorking($session);
my %tag = ( tagId => $versionTag->getId, status => "pending" );
$archive = $home->addChild({
className => 'WebGUI::Asset::Wobject::StoryArchive',
title => 'My Stories',
url => '/home/mystories',
styleTemplateId => $home->get('styleTemplateId'),
%tag,
});
$versionTag->commit;
WebGUI::Test->addToCleanup($versionTag);
@ -195,8 +193,7 @@ isa_ok($child, 'WebGUI::Asset::Wobject::Folder', '... will add folders, so impor
$child->purge;
my $tag1 = WebGUI::VersionTag->getWorking($session);
$tag{tagId} = $tag1->getId;
$child = $archive->addChild({className => 'WebGUI::Asset::Story', title => 'First Story', %tag}, @skipAutoCommit);
$child = $archive->addChild({className => 'WebGUI::Asset::Story', title => 'First Story', }, @skipAutoCommit);
$tag1->commit;
WebGUI::Test->addToCleanup($tag1);
isa_ok($child, 'WebGUI::Asset::Story', 'addChild added and returned a Story');
@ -233,8 +230,7 @@ my ($wgBdayMorn,undef) = $session->datetime->dayStartEnd($wgBday);
my ($yesterdayMorn,undef) = $session->datetime->dayStartEnd($yesterday);
my $tag2 = WebGUI::VersionTag->getWorking($session);
$tag{tagId} = $tag2->getId;
my $story = $oldFolder->addChild({ className => 'WebGUI::Asset::Story', title => 'WebGUI is released', keywords => 'roger,foxtrot,echo,all', %tag}, @skipAutoCommit);
my $story = $oldFolder->addChild({ className => 'WebGUI::Asset::Story', title => 'WebGUI is released', keywords => 'roger,foxtrot,echo,all', }, @skipAutoCommit);
$creationDateSth->execute([$wgBday, $story->getId]);
$tag2->commit;
WebGUI::Test->addToCleanup($tag2);
@ -245,8 +241,7 @@ WebGUI::Test->addToCleanup($tag2);
}
my $tag3 = WebGUI::VersionTag->getWorking($session);
$tag{tagId} = $tag3->getId;
my $pastStory = $newFolder->addChild({ className => 'WebGUI::Asset::Story', title => "Yesterday is history", %tag }, @skipAutoCommit);
my $pastStory = $newFolder->addChild({ className => 'WebGUI::Asset::Story', title => "Yesterday is history", }, @skipAutoCommit);
$creationDateSth->execute([$yesterday, $pastStory->getId]);
$tag3->commit;
WebGUI::Test->addToCleanup($tag3);
@ -317,10 +312,9 @@ cmp_deeply(
);
my $tag4 = WebGUI::VersionTag->getWorking($session);
$tag{tagId} = $tag4->getId;
my $story2 = $folder->addChild({ className => 'WebGUI::Asset::Story', title => 'Story 2', keywords => "roger,foxtrot,all", %tag}, @skipAutoCommit);
my $story3 = $folder->addChild({ className => 'WebGUI::Asset::Story', title => 'Story 3', keywords => "foxtrot,echo,all", %tag}, @skipAutoCommit);
my $story4 = $folder->addChild({ className => 'WebGUI::Asset::Story', title => 'Story 4', keywords => "roger,echo,all", %tag}, @skipAutoCommit);
my $story2 = $folder->addChild({ className => 'WebGUI::Asset::Story', title => 'Story 2', keywords => "roger,foxtrot,all", }, @skipAutoCommit);
my $story3 = $folder->addChild({ className => 'WebGUI::Asset::Story', title => 'Story 3', keywords => "foxtrot,echo,all", }, @skipAutoCommit);
my $story4 = $folder->addChild({ className => 'WebGUI::Asset::Story', title => 'Story 4', keywords => "roger,echo,all", }, @skipAutoCommit);
foreach my $storilet ($story2, $story3, $story4) {
$session->db->write("update asset set creationDate=$now where assetId=?",[$storilet->getId]);
}

View file

@ -29,7 +29,10 @@ WebGUI::Test->addToCleanup($user);
my $import_node = WebGUI::Test->asset;
# Create a Survey
my $tag = WebGUI::VersionTag->getWorking($session);
$survey = $import_node->addChild( { className => 'WebGUI::Asset::Wobject::Survey', } );
$tag->commit;
$survey = $survey->cloneFromDb;
isa_ok($survey, 'WebGUI::Asset::Wobject::Survey');
my $sJSON = $survey->getSurveyJSON;

View file

@ -33,7 +33,10 @@ $templateMock->mock_id($templateId);
my $templateVars;
$templateMock->mock('process', sub { $templateVars = $_[1]; } );
my $tag = WebGUI::VersionTag->getWorking($session);
my $thingy = $node->addChild({className=>'WebGUI::Asset::Wobject::Thingy'});
$tag->commit;
$thingy = $thingy->cloneFromDb;
# Test for a sane object type
isa_ok($thingy, 'WebGUI::Asset::Wobject::Thingy');
@ -522,9 +525,12 @@ cmp_deeply( $field, superhashof( \%fieldInfo ), 'field info saved' );
#----------------------------------------------------------------------------
# www_importForm
my $tag2 = WebGUI::VersionTag->getWorking($session);
my $thingy = WebGUI::Test->asset(
className => 'WebGUI::Asset::Wobject::Thingy',
);
$tag2->commit;
$thingy = $thingy->cloneFromDb;
my $thingId = $thingy->addThing();
my @fieldIds = (
$thingy->addField({

View file

@ -39,8 +39,6 @@ my $thingy = $node->addChild({
className => 'WebGUI::Asset::Wobject::Thingy',
groupIdView => 7,
url => 'some_thing',
tagId => $versionTag->getId,
status => "pending",
});
is $session->db->quickScalar('select count(*) from assetIndex where assetId=?',[$thingy->getId]), 0, 'no records yet';
$versionTag->commit;
@ -268,7 +266,7 @@ is @{ $search->getAssetIds }, 3, 'setup for indexContent, start with 3 records..
my $updateTag = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->addToCleanup($updateTag);
$thingy = $thingy->addRevision({ url => 'wild_thing', tagId => $updateTag->getId, status => "pending" });
$thingy = $thingy->addRevision({ url => 'wild_thing',});
$updateTag->commit;
$thingy = $thingy->cloneFromDb;