aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand/tfl.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
committerMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
commit09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch)
tree7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /t/cobrand/tfl.t
parent585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff)
parentcea89fb87a96943708a1db0f646492fbfaaf000f (diff)
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 't/cobrand/tfl.t')
-rw-r--r--t/cobrand/tfl.t40
1 files changed, 38 insertions, 2 deletions
diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t
index 8ddc3d671..142c7c14e 100644
--- a/t/cobrand/tfl.t
+++ b/t/cobrand/tfl.t
@@ -23,6 +23,10 @@ FixMyStreet::DB->resultset('BodyArea')->find_or_create({
area_id => 2457, # Epsom Ewell, outside London, for bus stop test
body_id => $body->id,
});
+FixMyStreet::DB->resultset('BodyArea')->find_or_create({
+ area_id => 2508, # Hackney
+ body_id => $body->id,
+});
my $superuser = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1);
my $staffuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $body, password => 'password');
$staffuser->user_body_permissions->create({
@@ -58,6 +62,13 @@ my $bromley_flytipping = $mech->create_contact_ok(
$bromley_flytipping->set_extra_metadata(group => [ 'Street cleaning' ]);
$bromley_flytipping->update;
+my $hackney = $mech->create_body_ok(2508, 'Hackney Council');
+$mech->create_contact_ok(
+ body_id => $hackney->id,
+ category => 'Abandoned Vehicle',
+ email => 'av-hackney@example.com',
+);
+
my $contact1 = $mech->create_contact_ok(
body_id => $body->id,
category => 'Bus stops',
@@ -188,6 +199,7 @@ FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'tfl', 'bromley', 'fixmystreet'],
MAPIT_URL => 'http://mapit.uk/',
COBRAND_FEATURES => {
+ category_groups => { tfl => 1 },
internal_ips => { tfl => [ '127.0.0.1' ] },
base_url => {
tfl => 'https://street.tfl'
@@ -413,6 +425,7 @@ subtest 'Dashboard CSV extra columns' => sub {
$mech->get_ok('/dashboard?export=1&category=Bus+stops');
$mech->content_contains('Category,Subcategory');
$mech->content_contains('Query,Borough');
+ $mech->content_contains(',Acknowledged,"Action scheduled",Fixed');
$mech->content_contains(',"Safety critical","Delivered to","Closure email at","Reassigned at","Reassigned by","Is the pole leaning?"');
$mech->content_contains('"Bus things","Bus stops"');
$mech->content_contains('"BR1 3UH",Bromley,');
@@ -430,10 +443,17 @@ subtest 'Dashboard CSV extra columns' => sub {
admin_user => $staffuser->name,
user => $staffuser,
});
+ FixMyStreet::DB->resultset('Comment')->create({
+ problem => $report, user => $report->user, anonymous => 't', text => 'Update text',
+ problem_state => 'action scheduled', state => 'confirmed', mark_fixed => 0,
+ confirmed => $dt,
+ });
$mech->get_ok('/dashboard?export=1');
$mech->content_contains('Query,Borough');
+ $mech->content_contains(',Acknowledged,"Action scheduled",Fixed');
$mech->content_contains(',"Safety critical","Delivered to","Closure email at","Reassigned at","Reassigned by"');
$mech->content_contains('(anonymous ' . $report->id . ')');
+ $mech->content_contains($dt . ',,,confirmed,51.4021');
$mech->content_contains(',,,yes,busstops@example.com,,' . $dt . ',"Council User"');
};
@@ -442,7 +462,8 @@ subtest 'Inspect form state choices' => sub {
my $id = $report->id;
$mech->get_ok("/report/$id");
$mech->content_lacks('for triage');
- $mech->content_lacks('action scheduled');
+ $mech->content_lacks('planned');
+ $mech->content_lacks('investigating');
};
subtest "change category, report resent to new location" => sub {
@@ -747,7 +768,7 @@ subtest 'Test no questionnaire sending' => sub {
};
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'tfl', 'bromley', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'tfl', 'bromley', 'fixmystreet', 'hackney' ],
MAPIT_URL => 'http://mapit.uk/',
COBRAND_FEATURES => {
internal_ips => { tfl => [ '127.0.0.1' ] },
@@ -863,6 +884,21 @@ for my $test (
'Trees'
],
},
+ {
+ host => 'hackney.fixmystreet.com',
+ name => "test no hackney categories on red route",
+ lat => 51.552287,
+ lon => -0.063326,
+ expected => [
+ 'Bus stops',
+ 'Flooding',
+ 'Grit bins',
+ 'Pothole',
+ 'Timings',
+ 'Traffic lights',
+ 'Trees'
+ ],
+ },
) {
subtest $test->{name} . ' on ' . $test->{host} => sub {
$mech->host($test->{host});