aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2019-10-17 19:22:33 +0100
committerDave Arter <davea@mysociety.org>2019-12-09 12:48:12 +0000
commitc711bedccb53bd06562f7407f3b9c342d3baf054 (patch)
tree870893bfa568b5cfad8c680fc11a5b90122b2cb9 /t/cobrand
parentc78c63f25cc53332b182296163e9560849b1dd4a (diff)
[TfL] Use London Boroughs for inspector areas and wards on /reports
Drops ‘Borough Council’ suffix from area names
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/tfl.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t
index bb074a872..c7db294ac 100644
--- a/t/cobrand/tfl.t
+++ b/t/cobrand/tfl.t
@@ -9,6 +9,7 @@ END { FixMyStreet::App->log->enable('info'); }
my $mech = FixMyStreet::TestMech->new;
my $body = $mech->create_body_ok(2482, 'TfL');
+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);
$staffuser->user_body_permissions->create({
body => $body,
@@ -155,6 +156,21 @@ subtest 'check report age on /around' => sub {
$mech->content_lacks($report->title);
};
+subtest 'TfL admin allows inspectors to be assigned to borough areas' => sub {
+ $mech->log_in_ok($superuser->email);
+
+ $mech->get_ok("/admin/users/" . $staffuser->id) or diag $mech->content;
+
+ $mech->submit_form_ok( { with_fields => {
+ area_ids => [2482],
+ } } );
+
+ $staffuser->discard_changes;
+ is_deeply $staffuser->area_ids, [2482], "User assigned to Bromley LBO area";
+
+ $staffuser->update({ area_ids => undef}); # so login below doesn't break
+};
+
subtest 'TfL staff can access TfL admin' => sub {
$mech->log_in_ok( $staffuser->email );
$mech->get_ok('/admin');