aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-05-15 18:29:28 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-05-28 17:19:27 +0100
commit8d4b1ee659a08c83715f8b59803ccbb50432761e (patch)
treeebac976b22f07dea05b72641b1f52cb466fec639 /t/app/controller/admin
parent440525f756ca445334a433d3acdadbdc1f588fc5 (diff)
Include role permissions when fetching user permissions.
Diffstat (limited to 't/app/controller/admin')
-rw-r--r--t/app/controller/admin/roles.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/app/controller/admin/roles.t b/t/app/controller/admin/roles.t
index 77c5b0033..6dd40cbb6 100644
--- a/t/app/controller/admin/roles.t
+++ b/t/app/controller/admin/roles.t
@@ -87,16 +87,23 @@ FixMyStreet::override_config {
roles => 'Role B',
}});
$mech->content_like(qr/<option[^>]*selected>Role B/);
+ $mech->content_like(qr/<input[^>]*checkbox[^>]*template_edit[^>]*checked/);
is $user->roles->count, 1, 'in one role';
is $user->user_body_permissions->count, 0, 'permissions removed';
};
+ subtest 'check user has the permissions of the role' => sub {
+ $mech->log_in_ok($user->email);
+ $mech->get_ok('/admin/templates');
+ };
+
subtest 'remove user from role' => sub {
+ $mech->log_in_ok( $editor->email );
+ $mech->get_ok('/admin/users/' . $user->id);
$mech->submit_form_ok({ with_fields => {
roles => undef,
}}, 'remove role');
};
-
};
subtest 'superuser can see all bodies' => sub {