diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-01-21 17:01:30 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-07-31 22:13:40 +0100 |
commit | e0b0c1650aab6ed688fd32a2b2917d90d1bae604 (patch) | |
tree | a72086c580dd4dd100650283b6391a112c99bb07 | |
parent | 04ce3fe145b50107eb83a9dcdd349ac1f110cae6 (diff) |
[Zurich] Add marking users as government-internal.
-rw-r--r-- | t/cobrand/zurich.t | 11 | ||||
-rw-r--r-- | templates/web/zurich/admin/users/form.html | 7 |
2 files changed, 17 insertions, 1 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t index d8e39c304..8def10d4f 100644 --- a/t/cobrand/zurich.t +++ b/t/cobrand/zurich.t @@ -98,7 +98,7 @@ my $superuser; subtest "set up superuser" => sub { $superuser = $mech->log_in_ok( 'super@example.org' ); # a user from body $zurich is a superuser, as $zurich has no parent id! - $superuser->update({ from_body => $zurich->id }); + $superuser->update({ name => 'Superuser', from_body => $zurich->id }); $EXISTING_REPORT_COUNT = get_export_rows_count($mech); $mech->log_out_ok; }; @@ -989,6 +989,15 @@ $mech->log_out_ok; subtest 'users at the top level can be edited' => sub { $mech->log_in_ok( $superuser->email ); $mech->get_ok('/admin/users/' . $superuser->id ); + $mech->content_contains('name="flagged">'); + $mech->submit_form_ok({ with_fields => { flagged => 1 } }); + $superuser->discard_changes; + is $superuser->flagged, 1, 'Marked as flagged'; + $mech->get_ok('/admin/users/' . $superuser->id ); + $mech->content_contains('name="flagged" checked'); + $mech->submit_form_ok({ with_fields => { flagged => 0 } }); + $superuser->discard_changes; + is $superuser->flagged, 0, 'Unmarked'; }; subtest 'A visit to /reports is okay' => sub { diff --git a/templates/web/zurich/admin/users/form.html b/templates/web/zurich/admin/users/form.html index 5182d943e..ec670a28a 100644 --- a/templates/web/zurich/admin/users/form.html +++ b/templates/web/zurich/admin/users/form.html @@ -19,6 +19,13 @@ </select> </li> + <li> + <label> + [% loc('government-internal') %] + <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]> + </label> + </li> + </ul> <p> <input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]" > |