aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-03-07 16:46:38 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-03-14 15:37:38 +0000
commit4ad523ad6a4950f91301e896b8f6a3d8e23afc06 (patch)
tree05d37bb624759e60d4a6bac75cf0502a99538c82 /t/app
parentecb6c0373a36b182fbc671602946805d64dcf679 (diff)
Use name at time of moderation, include superusers
This works better if e.g. a user stops being associated with a body.
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/moderate.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t
index 3a3c7a708..10287ab22 100644
--- a/t/app/controller/moderate.t
+++ b/t/app/controller/moderate.t
@@ -101,6 +101,7 @@ subtest 'Problem moderation' => sub {
problem_detail => 'Good good improved',
}});
$mech->base_like( qr{\Q$REPORT_URL\E} );
+ $mech->content_like(qr/Moderated by Bromley Council/);
$report->discard_changes;
is $report->title, 'Good [...] good';
@@ -330,6 +331,23 @@ subtest 'Update 2' => sub {
is $update2->text, 'update good good [...] good',
};
+subtest 'Now stop being a staff user' => sub {
+ $user->update({ from_body => undef });
+ $mech->get_ok($REPORT_URL);
+ $mech->content_contains('Moderated by Bromley Council');
+};
+
+subtest 'And do it as a superuser' => sub {
+ $user->update({ is_superuser => 1 });
+ $mech->get_ok($REPORT_URL);
+ $mech->submit_form_ok({ with_fields => {
+ %problem_prepopulated,
+ problem_title => 'Good good',
+ problem_detail => 'Good good improved',
+ }});
+ $mech->content_contains('Moderated by a FixMyStreet administrator');
+};
+
$update->delete;
$update2->delete;
$report->moderation_original_data->delete;