From 3c913228d18240d6a667b6f4b9c3533a8148291f Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 15 Aug 2008 17:50:03 +0000 Subject: [PATCH] add a test to check inheritUrlFromParent when creating an asset, rather than updating it --- t/Asset/Asset.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 036f00619..9ffbe51a6 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -146,7 +146,7 @@ $canViewMaker->prepare( }, ); -plan tests => 98 +plan tests => 99 + scalar(@fixIdTests) + scalar(@fixTitleTests) + 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle @@ -770,6 +770,19 @@ $iufpAsset2->update( { inheritUrlFromParent => 1 } ); $iufpAsset2->commit; is($iufpAsset2->getUrl, '/inheriturlfromparent01/inheriturlfromparent02', 'inheritUrlFromParent works'); +my $properties2a = { + # '1234567890123456789012' + id => 'inheritUrlFromParent2a', + title => 'inheritUrlFromParent2a', + className => 'WebGUI::Asset::Wobject::Layout', + url => 'inheriturlfromparent2a', + inheritUrlFromParent => 1, +}; + +my $iufpAsset2a = $iufpAsset->addChild($properties2a, $properties2a->{id}); +$iufpAsset2a->commit; +is($iufpAsset2a->getUrl, '/inheriturlfromparent01/inheriturlfromparent2a', 'inheritUrlFromParent works when created with the property'); + # works for setting, now try disabling. Should not change the URL. $iufpAsset2->update( { inheritUrlFromParent => 0 } ); $iufpAsset2->commit;