topStory template variables should be available in standAlone and not standAlone modes. Added template variables for delete and edit icons for the top story. Updated the tests, template and template variable help. Fixes bug #11851.

This commit is contained in:
Colin Kuskie 2010-09-09 11:56:50 -07:00
parent 9991a36c65
commit ef6e78fc27
6 changed files with 36 additions and 19 deletions

View file

@ -111,11 +111,6 @@ cmp_deeply(
cmp_deeply(
$templateVars->{story_loop},
[
{
title => 'bogs',
url => $session->url->append($topic->getUrl, 'func=viewStory;assetId='.$storyHandler->{'bogs'}->getId),
creationDate => $now,
},
{
title => 'red',
url => $session->url->append($topic->getUrl, 'func=viewStory;assetId='.$storyHandler->{'red'}->getId),
@ -131,11 +126,11 @@ cmp_deeply(
);
ok(
! exists $templateVars->{topStoryTitle}
&& ! exists $templateVars->{topStoryUrl}
&& ! exists $templateVars->{topStoryCreationDate}
&& ! exists $templateVars->{topStorySubtitle},
'topStory variables not present unless in standalone mode'
exists $templateVars->{topStoryTitle}
&& exists $templateVars->{topStoryUrl}
&& exists $templateVars->{topStoryCreationDate}
&& exists $templateVars->{topStorySubtitle},
'topStory variables present in standalone mode'
);
ok(! $templateVars->{standAlone}, 'viewTemplateVars: not in standalone mode');
@ -234,8 +229,9 @@ $topic->update({
$topic->{_standAlone} = 0;
$templateVars = $topic->viewTemplateVariables;
$templateVars = $topic->viewTemplateVariables;
my @topicInmates = map { $_->{title} } @{ $templateVars->{story_loop} };
unshift @topicInmates, $templateVars->{topStoryTitle};
cmp_deeply(
\@topicInmates,
[@inmates, 'Yesterday is history'], #extra for pastStory
@ -250,11 +246,6 @@ $templateVars = $topic->viewTemplateVariables;
cmp_deeply(
$templateVars->{story_loop},
[
{
title => 'bogs',
url => $storyHandler->{'bogs'}->getUrl,
creationDate => $now,
},
{
title => 'red',
url => $storyHandler->{'red'}->getUrl,
@ -336,7 +327,14 @@ $topic->update( { storySortOrder => 'Alphabetically' } );
$templateVars = $topic->viewTemplateVariables();
cmp_deeply(
$templateVars->{story_loop},
[
{
title => $templateVars->{topStoryTitle},
url => $templateVars->{topStoryUrl},
creationDate => $templateVars->{topStoryCreationDate},
},
@{ $templateVars->{story_loop} },
],
[
{
title => "aaaay was history but isn't any more",