aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/bromley.t34
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();