aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin/permissions.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-02-12 14:01:38 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-14 16:55:24 +0000
commitc2089e945132d36468f1d9a3bf08ae4d661cf44a (patch)
tree755780edf643ebd8babb910632eb259623fd8a24 /t/app/controller/admin/permissions.t
parent1825a09bbdfee97928a251a84534d859b1a43387 (diff)
Allow user to be associated with multiple areas.
Update database to store an array of IDs rather than only one; consequential changes to the admin and the dashboard to allow selection.
Diffstat (limited to 't/app/controller/admin/permissions.t')
-rw-r--r--t/app/controller/admin/permissions.t4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/app/controller/admin/permissions.t b/t/app/controller/admin/permissions.t
index 3fc221a63..036ec4509 100644
--- a/t/app/controller/admin/permissions.t
+++ b/t/app/controller/admin/permissions.t
@@ -181,6 +181,7 @@ FixMyStreet::override_config {
subtest "Unsetting user from_body removes all permissions and area " => sub {
is $user2->user_body_permissions->count, 1, 'user2 has 1 permission';
+ $user2->update({ area_ids => [123] }); # Set to check cleared
$mech->get_ok("/admin/user_edit/$user2_id");
$mech->content_contains('Moderate report details');
@@ -204,8 +205,9 @@ FixMyStreet::override_config {
"permissions[user_assign_areas]" => undef,
} } );
+ $user2->discard_changes;
is $user2->user_body_permissions->count, 0, 'user2 has had permissions removed';
- is $user2->area_id, undef, 'user2 has had area removed';
+ is $user2->area_ids, undef, 'user2 has had area removed';
};
};