aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin/roles.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-11-10 19:27:06 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-11-10 19:27:06 +0000
commitd8dd060a4c2f75e89a24f99634d91a6d8ef0e2bc (patch)
treeabb543c32c9e5f239cc66cff1bafa697f322ebd3 /t/app/controller/admin/roles.t
parentdb61249c59a96a2fad80523288b7d13881c10965 (diff)
parentb886792181eb77206054e73315a9d14cdb17e936 (diff)
Merge branch 'admin-auditing'
Diffstat (limited to 't/app/controller/admin/roles.t')
-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 6dd40cbb6..bc8371404 100644
--- a/t/app/controller/admin/roles.t
+++ b/t/app/controller/admin/roles.t
@@ -22,7 +22,7 @@ $user->user_body_permissions->create({
permission_type => 'report_edit_priority',
});
-FixMyStreet::DB->resultset("Role")->create({
+my $role_a = FixMyStreet::DB->resultset("Role")->create({
body => $body,
name => 'Role A',
permissions => ['moderate', 'user_edit'],
@@ -129,4 +129,11 @@ subtest 'superuser can see all bodies' => sub {
$mech->content_contains('Role C');
};
+subtest 'check log of the above' => sub {
+ my $id = FixMyStreet::DB->resultset("Role")->find({ name => "Role B" })->id;
+ $mech->get_ok('/admin/users/' . $editor->id . '/log');
+ $mech->content_contains('Added role <a href="/admin/roles/' . $id . '">Role B</a>');
+ $mech->content_contains('Deleted role ' . $role_a->id);
+};
+
done_testing();