diff options
author | Marius Halden <marius.h@lden.org> | 2016-07-06 19:53:50 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2016-07-06 19:53:50 +0200 |
commit | 02edc2af388e8e77c6da876bcec3633ea9161083 (patch) | |
tree | 59e65ccfc88c0795476db7ae709013862c7161c3 /t/app/controller/photo.t | |
parent | 2cf7f0dcf146143613beb102d0dd227238776b69 (diff) | |
parent | 26ef9e161e7ca4bbcf6bcbddb1ba4f215bc349ec (diff) |
Oppgrader til 1.8.4fiksgatami-prod-1.8
Merge branch 'fiksgatami-dev' into fiksgatami-prod
Diffstat (limited to 't/app/controller/photo.t')
-rw-r--r-- | t/app/controller/photo.t | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/t/app/controller/photo.t b/t/app/controller/photo.t index 425e3c4df..a065c7732 100644 --- a/t/app/controller/photo.t +++ b/t/app/controller/photo.t @@ -40,11 +40,15 @@ subtest "Check multiple upload worked" => sub { # submit the main form # can't post_ok as we lose the Content_Type header # (TODO rewrite with HTTP::Request::Common and request_ok) + $mech->get_ok('/report/new?lat=53.4031156&lon=-2.9840579'); + my ($csrf) = $mech->content =~ /name="token" value="([^"]*)"/; + $mech->post( '/report/new', Content_Type => 'form-data', Content => { submit_problem => 1, + token => $csrf, title => 'Test', lat => 53.4031156, lon => -2.9840579, # in Liverpool pc => 'L1 4LN', @@ -57,20 +61,17 @@ subtest "Check multiple upload worked" => sub { email => 'test@example.com', phone => '', category => 'Street lighting', - #password_sign_in => '', - #password_register => '', - #remember_me => undef, } ); 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/temp.1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg" alt="">\s*){3}], + qr[(<img align="right" src="/photo/temp.7f09ef2c3933731d47121fee1b8038b3fdd3bc77.jpeg" alt="">\s*){3}], 'Three uploaded pictures are all shown, safe'); $mech->content_contains( - 'name="upload_fileid" value="1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg,1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg,1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg"', + 'name="upload_fileid" value="7f09ef2c3933731d47121fee1b8038b3fdd3bc77.jpeg,7f09ef2c3933731d47121fee1b8038b3fdd3bc77.jpeg,7f09ef2c3933731d47121fee1b8038b3fdd3bc77.jpeg"', 'Returned upload_fileid contains expected hash, 3 times'); - my $image_file = path($UPLOAD_DIR, '1cdd4329ceee2234bd4e89cb33b42061a0724687.jpeg'); + my $image_file = path($UPLOAD_DIR, '7f09ef2c3933731d47121fee1b8038b3fdd3bc77.jpeg'); ok $image_file->exists, 'File uploaded to temp'; }; }; |