diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-04-08 21:11:48 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-04-08 22:05:21 +0100 |
commit | b7099e8e513fe64ec183b1403515f46a7cc25f19 (patch) | |
tree | 8a0399a49f90acfe5b74cf19d86585cc050455d7 /t/app/controller/photo.t | |
parent | 0802b7f04091c1022dce0d77cc806a46ecc4ebba (diff) |
Add PNG image support.
Store image type along with hash in photo column, and use that when
outputting images / generating URLs. Make sure all public photo URL
generation goes through appropriate functions, and change temp URLs
so the filename can be output directly from the list.
Diffstat (limited to 't/app/controller/photo.t')
-rw-r--r-- | t/app/controller/photo.t | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/app/controller/photo.t b/t/app/controller/photo.t index 39380e769..425e3c4df 100644 --- a/t/app/controller/photo.t +++ b/t/app/controller/photo.t @@ -65,10 +65,10 @@ subtest "Check multiple upload worked" => sub { ok $mech->success, 'Made request with multiple photo upload'; $mech->base_is('http://localhost/report/new'); $mech->content_like( - qr[(<img align="right" src="/photo/1cdd4329ceee2234bd4e89cb33b42061a0724687.temp.jpeg" alt="">\s*){3}], + qr[(<img align="right" src="/photo/temp.1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg" alt="">\s*){3}], 'Three uploaded pictures are all shown, safe'); $mech->content_contains( - 'name="upload_fileid" value="1cdd4329ceee2234bd4e89cb33b42061a0724687,1cdd4329ceee2234bd4e89cb33b42061a0724687,1cdd4329ceee2234bd4e89cb33b42061a0724687"', + 'name="upload_fileid" value="1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg,1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg,1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg"', 'Returned upload_fileid contains expected hash, 3 times'); my $image_file = path($UPLOAD_DIR, '1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg'); ok $image_file->exists, 'File uploaded to temp'; |