added more vars to GalleryAlbum and GalleryFile. fixed some tests

This commit is contained in:
Doug Bell 2008-04-17 22:54:19 +00:00
parent 5b16fcca51
commit 4ebed16c69
10 changed files with 148 additions and 2 deletions

View file

@ -54,6 +54,10 @@ for my $key ( keys %$exif ) {
delete $exif->{$key};
}
}
# Also remove things that Photo explicitly removed
for my $key ( qw{ Directory } ) {
delete $exif->{ $key };
}
$photo->setFile( WebGUI::Test->getTestCollateralPath("lamp.jpg") );

View file

@ -88,18 +88,41 @@ my $testTemplateVars = {
numberOfComments => scalar @{ $photo->getCommentIds },
resolutions_loop => ignore(), # Tested elsewhere
exifLoop => ignore(), # Tested elsewhere
# Gallery stuff
url_search => $gallery->getUrl('func=search'),
url_listFilesForCurrentUser => $gallery->getUrl('func=listFilesForUser'),
gallery_title => $gallery->get('title'),
gallery_menuTitle => $gallery->get('menuTitle'),
gallery_url => $gallery->getUrl,
# Album stuff
album_title => $album->get('title'),
album_menuTitle => $album->get('menuTitle'),
album_url => $album->getUrl,
album_thumbnailUrl => $album->getThumbnailUrl,
};
# Ignore all EXIF tags
# Ignore all EXIF tags, they're tested in exif.t
for my $tag ( keys %{ $photo->getExifData } ) {
$testTemplateVars->{ 'exif_' . $tag } = ignore();
}
# Add search vars
$gallery->appendTemplateVarsSearchForm( $testTemplateVars );
# Fix vars that are time-sensitive
$testTemplateVars->{ searchForm_creationDate_before }
= all(
re( qr/<input/ ),
re( qr/name="creationDate_before"/ ),
);
$testTemplateVars->{ searchForm_creationDate_after }
= all(
re( qr/<input/ ),
re( qr/name="creationDate_after"/ ),
);
cmp_deeply(
$photo->getTemplateVars,
$testTemplateVars,