Fix the groupToEditPost field defaulting to the groupIdEdit field. Make sure

that the added collab system in the test has a parent asset as well, to ensure
that the inheritance works properly.
This commit is contained in:
Chris Nehren 2007-11-07 22:29:21 +00:00
parent 8b23a6e7cf
commit 9db0430032
2 changed files with 16 additions and 5 deletions

View file

@ -742,7 +742,7 @@ sub definition {
uiLevel=>6,
fieldType=>'group',
filter=>'fixId',
defaultValue=>'4'
defaultValue=>$session->asset->get('groupIdEdit') || '4',
},
);

View file

@ -30,15 +30,27 @@ use WebGUI::User;
use WebGUI::Group;
use WebGUI::Asset::Wobject::Collaboration;
use WebGUI::Asset::Post;
use WebGUI::Asset::Wobject::Layout;
use Data::Dumper;
use Test::More tests => 3; # increment this value for each test you create
use Test::More tests => 4; # increment this value for each test you create
my $session = WebGUI::Test->session;
# Do our work in the import node
my $node = WebGUI::Asset->getImportNode($session);
my $collab = $node->addChild({className => 'WebGUI::Asset::Wobject::Collaboration', editTimeout => '1'});
# grab a named version tag
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name => 'Collaboration => groupToEditPost test'});
# 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'});
# set the layout as the current asset for the same reason
$session->asset($layout);
# finally, add the collab
my $collab = $layout->addChild({className => 'WebGUI::Asset::Wobject::Collaboration'});
# Test for a sane object type
isa_ok($collab, 'WebGUI::Asset::Wobject::Collaboration');
@ -56,6 +68,5 @@ TODO: {
END {
# Clean up after thyself
$collab->purge();
$versionTag->rollback();
}
# vim: syntax=perl filetype=perl