From 39127b7ec01cdd9a96a7b09dce2154690084290d Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Aug 2009 18:05:28 +0000 Subject: [PATCH] add tests for url extensions --- t/Asset/Asset.t | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index f57b27e63..873c3b8af 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -153,7 +153,7 @@ $canViewMaker->prepare( }, ); -plan tests => 112 +plan tests => 113 + scalar(@fixIdTests) + scalar(@fixTitleTests) + 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle @@ -367,7 +367,6 @@ $getTitleAsset->commit; $versionTag->commit; -my $origUrlExtension = $session->setting->get('urlExtension'); $session->setting->set('urlExtension', undef); is($importNode->fixUrl('1234'.'-'x235 . 'abcdefghij'), '1234'.'-'x235 . 'abcdefghij', 'fixUrl leaves long URLs under 250 characters alone'); @@ -412,13 +411,11 @@ 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'); -TODO: { - local $TODO = "Test the automatic adding of extensions to URLs"; - $session->setting->set('urlExtension', 'html'); - ok(0, "Setup test for adding URL extensions"); - - $session->setting->set('urlExtension', $origUrlExtension); -} +# Automatic extension adding +$session->setting->set('urlExtension', 'html'); +is($importNode->fixUrl('fixurl'), 'fixurl.html', 'Automatic adding of extensions works'); +is($importNode->fixUrl('fixurl.css'), 'fixurl.css', 'extensions aren\'t automatically added if there is already and extension'); +$session->setting->set('urlExtension', undef); ################################################################ #