Add keywords accessor for looking up Asset keywords.

This commit is contained in:
Colin Kuskie 2010-03-03 11:03:35 -08:00
parent d932543159
commit 122bd26afa
2 changed files with 35 additions and 1 deletions

View file

@ -21,7 +21,7 @@ use Test::Deep;
use Test::Exception;
use WebGUI::Exception;
plan tests => 59;
plan tests => 62;
my $session = WebGUI::Test->session;
@ -288,3 +288,16 @@ my $session = WebGUI::Test->session;
is $properties->{assetId}, $asset->assetId, '... works on assetId';
is $properties->{parentId}, 'I have a parent', '... works on parentId';
}
{
note "keywords";
my $default = WebGUI::Asset->getDefault($session);
my $asset = $default->addChild({
className => 'WebGUI::Asset::Snippet',
});
addToCleanup($asset);
can_ok($asset, 'keywords');
$asset->keywords('chess set');
is ($asset->keywords, 'chess set', 'set and get of keywords via direct accessor');
is ($asset->get('keywords'), 'chess set', 'via get method');
}