Add a getArchive method to the Story. Test it.
Make www_edit work.
This commit is contained in:
parent
d134336ffc
commit
426bc41b04
2 changed files with 34 additions and 7 deletions
|
|
@ -20,7 +20,7 @@ use Test::More; # increment this value for each test you create
|
|||
use Test::Deep;
|
||||
|
||||
my $tests = 1;
|
||||
plan tests => 12
|
||||
plan tests => 13
|
||||
+ $tests
|
||||
;
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ my $loaded = use_ok($class);
|
|||
my $story;
|
||||
|
||||
my $defaultNode = WebGUI::Asset->getDefault($session);
|
||||
my $archive = WebGUI::Asset->newByPropertyHashRef($session, {
|
||||
my $archive = $defaultNode->addChild({
|
||||
className => 'WebGUI::Asset::Wobject::StoryArchive',
|
||||
title => 'Test Archive',
|
||||
#1234567890123456789012
|
||||
|
|
@ -62,7 +62,7 @@ ok( WebGUI::Asset::Story->validParent($session), 'validParent: StoryArchive is
|
|||
#
|
||||
############################################################
|
||||
|
||||
$story = $defaultNode->addChild({
|
||||
$story = $archive->addChild({
|
||||
className => 'WebGUI::Asset::Story',
|
||||
title => 'Story 1',
|
||||
});
|
||||
|
|
@ -74,6 +74,14 @@ is($story->get('isHidden'), 1, 'by default, photos are hidden');
|
|||
$story->update({isHidden => 0});
|
||||
is($story->get('isHidden'), 1, 'photos cannot be set to not be hidden');
|
||||
|
||||
############################################################
|
||||
#
|
||||
# getArchive
|
||||
#
|
||||
############################################################
|
||||
|
||||
is($story->getArchive->getId, $archive->getId, 'getArchive gets the parent archive for the Story');
|
||||
|
||||
############################################################
|
||||
#
|
||||
# Photo JSON
|
||||
|
|
@ -118,7 +126,7 @@ cmp_deeply(
|
|||
}
|
||||
|
||||
END {
|
||||
WebGUI::VersionTag->getWorking($session)->rollback;
|
||||
$story->purge if $story;
|
||||
$archive->purge if $archive;
|
||||
WebGUI::VersionTag->getWorking($session)->rollback;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue