add export mode for StoryArchive.
Turn off search variables when in export mode.
This commit is contained in:
parent
fbbd63eaa5
commit
1ddf1b50a4
2 changed files with 50 additions and 7 deletions
|
|
@ -58,7 +58,7 @@ $canPostMaker->prepare({
|
|||
fail => [1, $reader ],
|
||||
});
|
||||
|
||||
my $tests = 31
|
||||
my $tests = 33
|
||||
+ $canPostMaker->plan
|
||||
;
|
||||
plan tests => 1
|
||||
|
|
@ -183,6 +183,18 @@ $creationDateSth->execute([$yesterday, $pastStory->getId]);
|
|||
|
||||
my $templateVars;
|
||||
$templateVars = $archive->viewTemplateVariables();
|
||||
|
||||
cmp_deeply(
|
||||
$templateVars,
|
||||
superhashof({
|
||||
searchHeader => ignore(),
|
||||
searchForm => ignore(),
|
||||
searchButton => ignore(),
|
||||
searchFooter => ignore(),
|
||||
}),
|
||||
'viewTemplateVars: search variables present'
|
||||
);
|
||||
|
||||
KEY: foreach my $key (keys %{ $templateVars }) {
|
||||
next KEY if isIn($key, qw/canPostStories addStoryUrl date_loop mode/);
|
||||
delete $templateVars->{$key};
|
||||
|
|
@ -387,6 +399,17 @@ cmp_bag(
|
|||
'keywordCloud template variable has keywords and correct links',
|
||||
);
|
||||
|
||||
$archive->{_exportMode} = 1;
|
||||
$templateVars = $archive->viewTemplateVariables();
|
||||
ok( ( !exists $templateVars->{searchHeader}
|
||||
&& !exists $templateVars->{searchForm}
|
||||
&& !exists $templateVars->{searchButton}
|
||||
&& !exists $templateVars->{searchForm}
|
||||
),
|
||||
'... export mode, no search variables present'
|
||||
);
|
||||
$archive->{_exportMode} = 0;
|
||||
|
||||
################################################################
|
||||
#
|
||||
# RSS and Atom checks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue