fixed #11928: Story Archive breaks if url has extension

This commit is contained in:
Paul Driver 2010-10-26 11:01:55 -07:00
parent 6fced77b37
commit 0d46331745
3 changed files with 31 additions and 3 deletions

View file

@ -63,7 +63,7 @@ $canPostMaker->prepare({
fail => [1, $reader ],
});
my $tests = 52
my $tests = 54
+ $canPostMaker->plan
;
plan tests => 1
@ -132,13 +132,25 @@ my $dt = DateTime->from_epoch(epoch => $now, time_zone => $session->datetime->ge
my $folderName = $dt->strftime('%B_%d_%Y');
$folderName =~ s/^(\w+_)0/$1/;
is($todayFolder->getTitle, $folderName, '... folder has the right name');
my $folderUrl = join '/', $archive->getUrl, lc $folderName;
my $folderUrl = $archive->getFolderUrl($folderName);
is($todayFolder->getUrl, $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 $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';
}
my $sameFolder = $archive->getFolder($now);
is($sameFolder->getId, $todayFolder->getId, 'call with same time returns the same folder');
undef $sameFolder;