revert oops
This commit is contained in:
parent
57b8cc4bae
commit
edebe7e2b9
9 changed files with 122 additions and 70 deletions
|
|
@ -69,18 +69,27 @@ plan tests => 7;
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test getFileIds and getFilePaginator
|
||||
cmp_bag( $album->getFileIds, [ map { $_->getId } @photos ] );
|
||||
cmp_bag( $album->getFileIds, [ map { $_->getId } @photos ], 'getFileIds returns ids of all photos' );
|
||||
|
||||
my $p = $album->getFilePaginator;
|
||||
isa_ok( $p, "WebGUI::Paginator" );
|
||||
cmp_deeply( $p->getPageData, subbagof( map { $_->getId } @photos ) );
|
||||
cmp_deeply( $p->getPageData, subbagof( map { $_->getId } @photos ), 'getPageData contains a subset of the ids o the photos');
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test getTemplateVars
|
||||
|
||||
# Is a superset of Asset->get
|
||||
# NOTE: url is Asset->getUrl
|
||||
cmp_deeply( $album->getTemplateVars, superhashof( { %{$album->get}, url => $album->getUrl, } ) );
|
||||
# NOTE: undef description remapped to empty string ''
|
||||
cmp_deeply(
|
||||
$album->getTemplateVars,
|
||||
superhashof( {
|
||||
%{$album->get},
|
||||
url => $album->getUrl,
|
||||
description => '',
|
||||
} ),
|
||||
q|getTemplateVariables returns the Album's asset properties|
|
||||
);
|
||||
|
||||
# Contains specific keys/values
|
||||
my $expected = {
|
||||
|
|
@ -114,7 +123,7 @@ my $expected = {
|
|||
=> WebGUI::User->new($session, 3)->username,
|
||||
};
|
||||
|
||||
cmp_deeply( $album->getTemplateVars, superhashof( $expected ) );
|
||||
cmp_deeply( $album->getTemplateVars, superhashof( $expected ), '... and also returns a set of other template variables' );
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test appendTemplateVarsFileLoop
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ use WebGUI::Asset::Wobject::SyndicatedContent;
|
|||
|
||||
my $session = WebGUI::Test->session;
|
||||
my %var;
|
||||
my ($items, @rss_feeds);
|
||||
my (@rss_feeds);
|
||||
|
||||
##############################
|
||||
## SETUP ##
|
||||
|
|
@ -99,8 +99,10 @@ my $rss_info = WebGUI::Asset::Wobject::SyndicatedContent::_get_rss_data($session
|
|||
ok(ref($rss_info) eq 'HASH', "Hashref returned from _get_rss_data");
|
||||
push(@rss_feeds, $rss_info);
|
||||
|
||||
my $xml_list = WebGUI::Asset::Wobject::SyndicatedContent::_create_interleaved_items($items, \@rss_feeds , $max_headlines, $hasTermsRegex);
|
||||
ok($xml_list , "Got results back from XML " );
|
||||
|
||||
my $items = [];
|
||||
WebGUI::Asset::Wobject::SyndicatedContent::_create_interleaved_items($items, \@rss_feeds , $max_headlines, $hasTermsRegex);
|
||||
ok($items , "Got results back from XML" );
|
||||
|
||||
my($item_loop,$rss_feeds) = $syndicated_content->_get_items(\@validated_urls, $max_headlines);
|
||||
ok(ref($item_loop) eq 'ARRAY',"Arrayref of items returned from _get_items" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue