From 486edcb4d15f192e12bda89a51e446ad4afe54fc Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 13 Jul 2008 18:32:04 +0000 Subject: [PATCH] comment the GalleryAlbum view tests, and fix a test that was failing due to a bug fix --- t/Asset/Wobject/GalleryAlbum/view.t | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/t/Asset/Wobject/GalleryAlbum/view.t b/t/Asset/Wobject/GalleryAlbum/view.t index b67c49497..69d4ae2a0 100644 --- a/t/Asset/Wobject/GalleryAlbum/view.t +++ b/t/Asset/Wobject/GalleryAlbum/view.t @@ -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