aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-11-27 21:38:28 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-12-16 16:58:33 +0000
commit749fe96b5b987bec29fb608acfcbdb81e57aaebf (patch)
tree80164c1305c26698c13286dd3de506198a240673 /t
parentd28745730bf22b9447645fd6543b4a164976f761 (diff)
Remove risk of infinite loop in PhotoSet.
Use a separate attribute for data direct from a database row when creating a PhotoSet, so that data will always contain one or more photo IDs.
Diffstat (limited to 't')
-rw-r--r--t/app/model/photoset.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/app/model/photoset.t b/t/app/model/photoset.t
index 938c77b2a..cfb5236a8 100644
--- a/t/app/model/photoset.t
+++ b/t/app/model/photoset.t
@@ -5,7 +5,6 @@ use Test::Exception;
use utf8;
use FixMyStreet::DB;
-use Data::Dumper;
use DateTime;
use Path::Tiny 'path';
use File::Temp 'tempdir';
@@ -59,6 +58,7 @@ subtest 'Photoset with photo inline in DB' => sub {
my $report = make_report( $image_path->slurp );
my $photoset = $report->get_photoset();
is $photoset->num_images, 1, 'Found just 1 image';
+ is $photoset->data, '1cdd4329ceee2234bd4e89cb33b42061a0724687';
};
$image_path->copy( path( $UPLOAD_DIR, '0123456789012345678901234567890123456789.jpeg' ) );
@@ -68,7 +68,7 @@ subtest 'Photoset with 1 referenced photo' => sub {
is $photoset->num_images, 1, 'Found just 1 image';
};
-subtest 'Photoset with 1 referenced photo' => sub {
+subtest 'Photoset with 3 referenced photo' => sub {
my $report = make_report( '0123456789012345678901234567890123456789,0123456789012345678901234567890123456789,0123456789012345678901234567890123456789' );
my $photoset = $report->get_photoset();
is $photoset->num_images, 3, 'Found 3 images';