diff options
Diffstat (limited to 't')
-rw-r--r-- | t/open311/getservicerequestupdates.t | 9 | ||||
-rw-r--r-- | t/open311/post-service-request-updates.t | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/t/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t index c3ce2118a..e53921156 100644 --- a/t/open311/getservicerequestupdates.t +++ b/t/open311/getservicerequestupdates.t @@ -12,6 +12,7 @@ use_ok( 'Open311' ); use_ok( 'Open311::GetServiceRequestUpdates' ); use DateTime; use DateTime::Format::W3CDTF; +use File::Temp 'tempdir'; use FixMyStreet::DB; my $user = FixMyStreet::DB->resultset('User')->find_or_create( @@ -508,6 +509,13 @@ for my $test ( } subtest 'Update with media_url includes image in update' => sub { + my $UPLOAD_DIR = tempdir( CLEANUP => 1 ); + FixMyStreet::override_config { + PHOTO_STORAGE_BACKEND => 'FileSystem', + PHOTO_STORAGE_OPTIONS => { + UPLOAD_DIR => $UPLOAD_DIR, + }, + }, sub { my $guard = LWP::Protocol::PSGI->register(t::Mock::Static->to_psgi_app, host => 'example.com'); my $local_requests_xml = setup_xml($problem->external_id, 1, ""); @@ -527,6 +535,7 @@ subtest 'Update with media_url includes image in update' => sub { is $c->external_id, 638344; is $c->photo, '74e3362283b6ef0c48686fb0e161da4043bbcc97.jpeg', 'photo exists'; $problem->comments->delete; + }; }; subtest 'Update with customer_reference adds reference to problem' => sub { diff --git a/t/open311/post-service-request-updates.t b/t/open311/post-service-request-updates.t index 57b8f9a2a..6a7bc6ff2 100644 --- a/t/open311/post-service-request-updates.t +++ b/t/open311/post-service-request-updates.t @@ -15,8 +15,8 @@ my $params = { endpoint => 'endpoint', jurisdiction => 'home', }; -my $bromley = $mech->create_body_ok(2482, 'Bromley', { %$params, send_extended_statuses => 1, id => 5 }); -my $oxon = $mech->create_body_ok(2237, 'Oxfordshire', { %$params, id => 55 }); +my $bromley = $mech->create_body_ok(2482, 'Bromley', { %$params, send_extended_statuses => 1 }); +my $oxon = $mech->create_body_ok(2237, 'Oxfordshire', { %$params, id => "5" . $bromley->id }); my $bucks = $mech->create_body_ok(2217, 'Buckinghamshire', $params); my $lewisham = $mech->create_body_ok(2492, 'Lewisham', $params); |