diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-14 13:19:09 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-14 16:39:36 +0100 |
commit | 46fd6e9bfe5d00230aec44188e66c60e89c416e5 (patch) | |
tree | ef042924605697ab7ed48013e57bb228d41a09f8 /t/cobrand | |
parent | 2a6ef907881ff0840f17170c59c973c7943c7943 (diff) |
[Bromley] Include TfL reports on map, in grey.
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bromley.t | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/t/cobrand/bromley.t b/t/cobrand/bromley.t index b3fb3564b..d62a0ad0f 100644 --- a/t/cobrand/bromley.t +++ b/t/cobrand/bromley.t @@ -18,8 +18,16 @@ $contact->set_extra_fields( { code => 'service_request_id_ext', datatype => 'number', }, ); $contact->update; +my $tfl = $mech->create_body_ok( 2482, 'TfL'); +$mech->create_contact_ok( + body_id => $tfl->id, + category => 'Traffic Lights', + email => 'tfl@example.org', +); my @reports = $mech->create_problems_for_body( 1, $body->id, 'Test', { + latitude => 51.402096, + longitude => 0.015784, cobrand => 'bromley', user => $user, }); @@ -51,8 +59,8 @@ for my $test ( desc => 'testing special Open311 behaviour', updates => {}, expected => { - 'attribute[easting]' => 529025, - 'attribute[northing]' => 179716, + 'attribute[easting]' => 540315, + 'attribute[northing]' => 168935, 'attribute[service_request_id_ext]' => $report->id, 'attribute[report_title]' => 'Test Test 1 for ' . $body->id, 'jurisdiction_id' => 'FMS', @@ -66,8 +74,8 @@ for my $test ( postcode => '' }, expected => { - 'attribute[easting]' => 529025, - 'attribute[northing]' => 179716, + 'attribute[easting]' => 540315, + 'attribute[northing]' => 168935, 'attribute[service_request_id_ext]' => $report->id, 'jurisdiction_id' => 'FMS', 'address_id' => '#NOTPINPOINTED#', @@ -168,4 +176,22 @@ for my $test ( }; } +subtest 'check display of TfL reports' => sub { + $mech->create_problems_for_body( 1, $tfl->id, 'TfL Test', { + latitude => 51.402096, + longitude => 0.015784, + cobrand => 'bromley', + user => $user, + }); + $mech->get_ok( '/report/' . $report->id ); + FixMyStreet::override_config { + ALLOWED_COBRANDS => 'bromley', + MAPIT_URL => 'http://mapit.uk/', + }, sub { + $mech->follow_link_ok({ text_regex => qr/Back to all reports/i }); + }; + $mech->content_like(qr{<a title="TfL Test[^>]*www.example.org[^>]*><img[^>]*grey}); + $mech->content_like(qr{<a title="Test Test[^>]*bromley.example.org[^>]*><img[^>]*yellow}); +}; + done_testing(); |