Story Archive now plays nice with urlExtensions
This commit is contained in:
parent
e67ad18517
commit
fa471df450
5 changed files with 51 additions and 9 deletions
|
|
@ -63,7 +63,7 @@ $canPostMaker->prepare({
|
|||
fail => [1, $reader ],
|
||||
});
|
||||
|
||||
my $tests = 54
|
||||
my $tests = 56
|
||||
+ $canPostMaker->plan
|
||||
;
|
||||
plan tests => 1
|
||||
|
|
@ -133,22 +133,34 @@ my $folderName = $dt->strftime('%B_%d_%Y');
|
|||
$folderName =~ s/^(\w+_)0/$1/;
|
||||
is($todayFolder->getTitle, $folderName, '... folder has the right name');
|
||||
my $folderUrl = $archive->getFolderUrl($folderName);
|
||||
is($todayFolder->getUrl, $folderUrl, '... folder has the right URL');
|
||||
is($todayFolder->get('url'), $folderUrl, '... folder has the right URL');
|
||||
is($todayFolder->getParent->getId, $archive->getId, '... created folder has the right parent');
|
||||
is($todayFolder->get('state'), 'published', '... created folder is published');
|
||||
is($todayFolder->get('status'), 'approved', '... created folder is approved');
|
||||
is($todayFolder->get('styleTemplateId'), $archive->get('styleTemplateId'), '... created folder has correct styleTemplateId');
|
||||
|
||||
{
|
||||
my $undo = WebGUI::Test->overrideSetting(urlExtension => 'ext');
|
||||
my $arch2 = $home->addChild({
|
||||
className => $class,
|
||||
url => 'home/extension-tester.ext',
|
||||
title => 'Extension Tester',
|
||||
});
|
||||
addToCleanup($arch2);
|
||||
ok defined $arch2->getFolder($now), 'getFolder with url extension';
|
||||
is $arch2->getFolderUrl('blah'), '/home/extension-tester/blah',
|
||||
'folder urls have extension properly stripped';
|
||||
|
||||
is $arch2->get('url'),
|
||||
'home/extension-tester.ext',
|
||||
'ext added';
|
||||
|
||||
is $arch2->getFolderUrl('blah'),
|
||||
'home/extension-tester/blah.ext',
|
||||
'folder url: strip extension from parent and add to child';
|
||||
|
||||
my $folder = $arch2->getFolder($now);
|
||||
ok defined $folder, 'getFolder with url extension';
|
||||
|
||||
is $folder->get('url'),
|
||||
$arch2->getFolderUrl($folder->getMenuTitle),
|
||||
'getFolderUrl and folder getUrl match';
|
||||
}
|
||||
|
||||
my $sameFolder = $archive->getFolder($now);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue