Add top story subtitle to match the spec.
This commit is contained in:
parent
26d87bf607
commit
e06d53c122
5 changed files with 18 additions and 2 deletions
Binary file not shown.
|
|
@ -168,6 +168,7 @@ sub viewTemplateVariables {
|
|||
##Note, this could have saved from the loop above, but this looks more clean and encapsulated to me.
|
||||
my $topStory = WebGUI::Asset->new($session, $topStoryData->{assetId}, $topStoryData->{className}, $topStoryData->{revisionDate});
|
||||
$var->{topStoryTitle} = $topStory->getTitle;
|
||||
$var->{topStorySubtitle} = $topStory->get('subtitle');
|
||||
$var->{topStoryUrl} = $session->url->append($self->getUrl, 'func=viewStory;assetId='.$topStoryData->{assetId}),
|
||||
$var->{topStoryCreationDate} = $topStory->get('creationDate');
|
||||
##TODO: Photo variables
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ our $HELP = {
|
|||
],
|
||||
},
|
||||
{ name => 'topStoryTitle' },
|
||||
{ name => 'topStorySubtitle' },
|
||||
{ name => 'topStoryUrl' },
|
||||
{ name => 'topStoryCreationDate' },
|
||||
],
|
||||
|
|
|
|||
|
|
@ -93,6 +93,12 @@ our $I18N = {
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'topStorySubtitle' => {
|
||||
message => q|The subtitle of the top story.|,
|
||||
context => q|Template variable.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'topStoryCreationDate' => {
|
||||
message => q|The epoch date when the top story was created, or submitted, to its Story Archive.|,
|
||||
context => q|Template variable.|,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ my $session = WebGUI::Test->session;
|
|||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
my $tests = 10;
|
||||
my $tests = 11;
|
||||
plan tests => 1 + $tests;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -69,6 +69,8 @@ STORY: foreach my $name (@characters) {
|
|||
$creationDateSth->execute([$now, $namedStory->getId]);
|
||||
}
|
||||
|
||||
$storyHandler->{bogs}->update({subtitle => 'drinking his food through a straw'});
|
||||
|
||||
my $topic;
|
||||
|
||||
SKIP: {
|
||||
|
|
@ -116,7 +118,8 @@ cmp_deeply(
|
|||
ok(
|
||||
! exists $templateVars->{topStoryTitle}
|
||||
&& ! exists $templateVars->{topStoryUrl}
|
||||
&& ! exists $templateVars->{topStoryCreationDate},
|
||||
&& ! exists $templateVars->{topStoryCreationDate}
|
||||
&& ! exists $templateVars->{topStorySubtitle},
|
||||
'topStory variables not present unless in standalone mode'
|
||||
);
|
||||
ok(! $templateVars->{standAlone}, 'viewTemplateVars: not in standalone mode');
|
||||
|
|
@ -156,6 +159,11 @@ cmp_deeply(
|
|||
);
|
||||
|
||||
is($templateVars->{topStoryTitle}, 'bogs', 'viewTemplateVars in standalone mode, title');
|
||||
is(
|
||||
$templateVars->{topStorySubtitle},
|
||||
'drinking his food through a straw',
|
||||
'viewTemplateVars in standalone mode, subtitle'
|
||||
);
|
||||
is(
|
||||
$templateVars->{topStoryUrl},
|
||||
$session->url->append($topic->getUrl, 'func=viewStory;assetId='.$storyHandler->{'bogs'}->getId),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue