Tests for the new topic template variable

This commit is contained in:
Paul Driver 2011-01-11 12:47:58 -06:00
parent 2208864504
commit 7c9d0863ef

View file

@ -31,7 +31,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
plan tests => 20;
plan tests => 21;
#----------------------------------------------------------------------------
# put your tests here
@ -155,7 +155,8 @@ cmp_variable_loop(
);
ok(
exists $templateVars->{topStoryTitle}
exists $templateVars->{topStory}
&& exists $templateVars->{topStoryTitle}
&& exists $templateVars->{topStoryUrl}
&& exists $templateVars->{topStoryCreationDate}
&& exists $templateVars->{topStorySubtitle},
@ -197,6 +198,13 @@ cmp_variable_loop(
'viewTemplateVars has right number and contents in the story_loop in standalone mode. Top story not present in story_loop'
);
cmp_deeply($templateVars->{topStory}, superhashof({
title => 'bogs',
subtitle => 'drinking his food through a straw',
creationDate => $now,
}));
is($templateVars->{topStoryTitle}, 'bogs', '... topStoryTitle');
is(
$templateVars->{topStorySubtitle},