From 0e299cc18b69f97d0cb1e44a666a85ed4d204749 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Thu, 12 Jun 2008 19:37:44 +0000 Subject: [PATCH] fixed photo/view test --- t/Asset/File/GalleryFile/Photo/view.t | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/t/Asset/File/GalleryFile/Photo/view.t b/t/Asset/File/GalleryFile/Photo/view.t index d9a645f52..05330d449 100644 --- a/t/Asset/File/GalleryFile/Photo/view.t +++ b/t/Asset/File/GalleryFile/Photo/view.t @@ -86,9 +86,9 @@ my $testTemplateVars = { fileUrl => $photo->getFileUrl, thumbnailUrl => $photo->getThumbnailUrl, numberOfComments => scalar @{ $photo->getCommentIds }, - resolutions_loop => ignore(), # Tested elsewhere exifLoop => ignore(), # Tested elsewhere - + isPending => ( $photo->get("status") eq "pending" ), + # Gallery stuff url_search => $gallery->getUrl('func=search'), url_listFilesForCurrentUser => $gallery->getUrl('func=listFilesForUser'), @@ -110,6 +110,18 @@ for my $tag ( keys %{ $photo->getExifData } ) { # Add search vars $gallery->appendTemplateVarsSearchForm( $testTemplateVars ); +# Add resolution vars +for my $resolution ( @{ $photo->getResolutions } ) { + my $label = $resolution; + $label =~ s/\.[^.]+$//; + my $downloadUrl = $photo->getStorageLocation->getUrl( $resolution ); + push @{ $testTemplateVars->{ resolutions_loop } }, { + resolution => $label, + url_download => $downloadUrl, + }; + $testTemplateVars->{ "resolution_" . $resolution } = $downloadUrl; +} + # Fix vars that are time-sensitive $testTemplateVars->{ searchForm_creationDate_before } = all(