diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 78a7da1dd..919532d5a 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -20,7 +20,7 @@ use WebGUI::Asset::Wobject::Folder; use WebGUI::AssetVersioning; use WebGUI::VersionTag; -use Test::More tests => 47; # increment this value for each test you create +use Test::More tests => 48; # increment this value for each test you create use Test::MockObject; my $session = WebGUI::Test->session; @@ -42,24 +42,31 @@ my $properties = { my $fixUrlAsset = $defaultAsset->addChild($properties, $properties->{id}); - # '1234567890123456789012' +# '1234567890123456789012' $properties->{id} = 'fixUrlAsset00000000013'; $properties->{url} = 'fixUrlFolderURL9'; my $fixUrlAsset2 = $defaultAsset->addChild($properties, $properties->{id}); - # '1234567890123456789012' +# '1234567890123456789012' $properties->{id} = 'fixUrlAsset00000000014'; $properties->{url} = 'fixUrlFolderURL00'; my $fixUrlAsset3 = $defaultAsset->addChild($properties, $properties->{id}); - # '1234567890123456789012' +# '1234567890123456789012' $properties->{id} = 'fixUrlAsset00000000015'; $properties->{url} = 'fixUrlFolderURL100'; my $fixUrlAsset4 = $defaultAsset->addChild($properties, $properties->{id}); +delete $properties->{url}; +# '1234567890123456789012' +$properties->{id} = 'fixUrlAsset00000000016'; +$properties->{menuTitle} = 'fix url folder url autogenerated'; + +my $fixUrlAsset5 = $defaultAsset->addChild($properties, $properties->{id}); + $versionTag->commit; # Test the new constructor @@ -225,6 +232,8 @@ is($importNode->fixUrl('fixUrlFolderURL9'), 'fixurlfolderurl10', 'increments is($importNode->fixUrl('fixUrlFolderURL00'), 'fixurlfolderurl01', 'initial zeroes preserved 00 -> 01'); is($importNode->fixUrl('fixUrlFolderURL100'), 'fixurlfolderurl101', '100->101'); +is($fixUrlAsset5->fixUrl(), 'home/fix-url-folder-url-autogenerated', 'fixUrl will autogenerate a url if not provided one'); + $session->setting->set('urlExtension', 'html'); END: {