Added POD and test for RenderThingData macro update

This commit is contained in:
Chris Hanson 2011-06-16 18:07:54 -05:00
parent 995eb34b5a
commit 8a6ba94191
2 changed files with 10 additions and 2 deletions

View file

@ -23,7 +23,7 @@ Package WebGUI::Macro::RenderThingData
Macro that allows users to render thing data.
=head2 process ( thingURL, templateHint )
=head2 process ( thingURL, templateHint, callerAssetId )
=head3 thingHint
@ -33,6 +33,11 @@ The URL from which to pull the thingId and thingDataId
Optional. Specifies the templateId or template url to use. If omitted, the default thingy view template will be used.
=head3 callerAssetId
Optional. Passes an assetId to the template (as a template var named callerAssetId) so that the the assetId of of
the caller can be known by the called template. Generally you should pass <tmpl_var assetId>.
=cut

View file

@ -39,7 +39,7 @@ WebGUI::Test->addToCleanup(sub {
WebGUI::Test->unmockAssetUrl($templateUrl);
});
plan tests => 6;
plan tests => 7;
my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
@ -119,3 +119,6 @@ $output = WebGUI::Macro::RenderThingData::process($session, $thing_url, $templat
ok $templateProcessed, '... passed template url, template processed';
$templateProcessed = 0;
$output = WebGUI::Macro::RenderThingData::process($session, $thing_url, $templateUrl, "fakeAssetId");
ok $templateVars->{'callerAssetId'} eq 'fakeAssetId', '... passed callerAssetId, template var was passed';
$templateProcessed = 0;