aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_updates.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-07-10 14:38:17 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-07-14 18:25:19 +0100
commit67823bc788ce744e1228a8602b9a5aa805771ced (patch)
tree0b1eddd4e071314573e52206d0061cab022e1cd0 /t/app/controller/report_updates.t
parenteed6158981240afce10824e82fa86f14b38f3167 (diff)
Centralise update creation to include fields.
Given the user, we can infer the name if not provided, and the extra data if a staff user. We can also provide defaults for various other fields. Always have superuser take precedence over from_body.
Diffstat (limited to 't/app/controller/report_updates.t')
-rw-r--r--t/app/controller/report_updates.t6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index e97b04f12..3198cf70c 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -1096,10 +1096,10 @@ subtest $test->{desc} => sub {
unlike $update_meta->[1], qr/Commenter/, 'commenter name not included';
like $update_meta->[0], qr/investigating/i, 'update meta includes state change';
- if ($test->{body} || $test->{bodyuser}) {
- like $update_meta->[1], qr/Westminster/, 'body user update uses body name';
- } elsif ($test->{superuser}) {
+ if ($test->{superuser}) {
like $update_meta->[1], qr/an administrator/, 'superuser update says an administrator';
+ } elsif ($test->{body} || $test->{bodyuser}) {
+ like $update_meta->[1], qr/Westminster/, 'body user update uses body name';
}
ok $user->user_body_permissions->create({