add metadata to assets inside an AssetReport

Thanks to SquOnk for the patch.
This commit is contained in:
Doug Bell 2011-05-20 14:25:40 -05:00
parent 52294139a0
commit c471728ca4
2 changed files with 12 additions and 2 deletions

View file

@ -88,6 +88,13 @@ $ar->update( {
#----------------------------------------------------------------------------
# getTemplateVars
# Add a metadata variable to test
my $mdFieldId = $sn->addMetaDataField( undef, "TESTFIELD", undef, undef, "Text", );
WebGUI::Test->addToCleanup( sub{
WebGUI::Asset->getRoot( $session )->deleteMetaDataField( $mdFieldId )
} );
$sn->updateMetaData( $mdFieldId, "TESTVALUE" );
cmp_deeply(
$ar->getTemplateVars,
hash( {
@ -118,7 +125,7 @@ cmp_deeply(
'pagination.isFirstPage' => ignore(),
'pagination.nextPageText' => ignore(),
'pagination.firstPage' => ignore(),
'asset_loop' => [{ %{ $sn->get } }],
'asset_loop' => [{ %{ $sn->get }, %{ $sn->getMetaDataAsTemplateVariables } }],
} ),
"getTemplateVars returns complete and correct data structure",
);