getRssFeedItems for StoryArchive, with tests.

A couple of quick rss/atom url tests.
This commit is contained in:
Colin Kuskie 2009-04-08 22:46:42 +00:00
parent 3853e4dd02
commit efef611b03
2 changed files with 68 additions and 5 deletions

View file

@ -58,11 +58,11 @@ $canPostMaker->prepare({
fail => [1, $reader ],
});
my $tests = 1;
plan tests => 28
+ $tests
+ $canPostMaker->plan
;
my $tests = 31
+ $canPostMaker->plan
;
plan tests => 1
+ $tests;
#----------------------------------------------------------------------------
# put your tests here
@ -387,6 +387,45 @@ cmp_bag(
'keywordCloud template variable has keywords and correct links',
);
################################################################
#
# RSS and Atom checks
#
################################################################
is($archive->getRssFeedUrl, '/home/mystories?func=viewRss', 'RSS Feed Url');
is($archive->getAtomFeedUrl, '/home/mystories?func=viewAtom', 'Atom Feed Url');
$archive->update({itemsPerFeed => 3});
cmp_deeply(
$archive->getRssFeedItems(),
[
{
title => 'First Story',
description => ignore(),
'link' => ignore(),
date => ignore(),
author => ignore(),
},
{
title => 'Story 2',
description => ignore(),
'link' => ignore(),
date => ignore(),
author => ignore(),
},
{
title => 'Story 3',
description => ignore(),
'link' => ignore(),
date => ignore(),
author => ignore(),
},
],
'rssFeedItems'
);
}
#----------------------------------------------------------------------------