Refactor code to force assets to always be hidden into a role and use it.

This commit is contained in:
Colin Kuskie 2010-02-16 08:50:00 -08:00
parent 1d777d4596
commit abaeab36e0
8 changed files with 71 additions and 52 deletions

View file

@ -19,7 +19,7 @@ use WebGUI::Asset::Event;
use Test::More; # increment this value for each test you create
use Test::Deep;
plan tests => 18;
plan tests => 20;
my $session = WebGUI::Test->session;
@ -131,3 +131,22 @@ ok($session->id->valid($event6a->get('storageId')), 'addRevision gives the new r
isnt($event6a->get('storageId'), $event6->get('storageId'), '... and it is different from the previous revision');
my $versionTag2 = WebGUI::VersionTag->getWorking($session);
WebGUI::Test->tagsToRollback($versionTag2);
$versionTag2->commit;
my $event7 = $cal->addChild(
{
className => 'WebGUI::Asset::Event',
assetId => 'EventAssetTestStorage6',
url => 'hidden_event',
}, undef, undef, { skipNotifications => 1, skipAutoCommitWorkflows => 1 },
);
my $tag = WebGUI::VersionTag->getWorking($session);
$tag->commit;
addToCleanup($tag);
is $event7->isHidden, 1, 'isHidden set to 1 by default';
$event7->isHidden(0);
is $event7->isHidden, 1, 'isHidden cannot be set to 0';