aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-02-05 22:24:22 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-02-06 16:55:16 +0000
commitdb8898037b67265b18ffac9ef8b6696dc6d33d22 (patch)
treeb29d1aa0158319ae22b505054c6ccdc83eb9cfcf /t
parent35445b8cc7ae02acdfbfc3e2e9da15b022736906 (diff)
Add admin ability to log user out.
Diffstat (limited to 't')
-rw-r--r--t/app/controller/admin/users.t10
-rw-r--r--t/app/controller/report_new.t8
2 files changed, 12 insertions, 6 deletions
diff --git a/t/app/controller/admin/users.t b/t/app/controller/admin/users.t
index e6cf51449..187652b3c 100644
--- a/t/app/controller/admin/users.t
+++ b/t/app/controller/admin/users.t
@@ -410,4 +410,14 @@ subtest "Hiding user's reports from admin" => sub {
is $c, $count_u;
};
+subtest "Logging user out" => sub {
+ my $mech2 = FixMyStreet::TestMech->new;
+ $mech2->log_in_ok($user->email);
+ $mech2->logged_in_ok;
+
+ $mech->get_ok( '/admin/user_edit/' . $user->id );
+ $mech->submit_form_ok({ button => 'logout_everywhere' }, 'Logging user out');
+ $mech2->not_logged_in_ok;
+};
+
done_testing();
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index e0fe205bd..95461fa8f 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -1236,9 +1236,7 @@ for my $test (
is $user->title, $test->{'user_title'}, 'user title correct';
is_deeply $extras, $test->{extra}, 'extra contains correct values';
- $user->problems->delete;
- $user->alerts->delete;
- $user->delete;
+ $mech->delete_user($user);
};
}
@@ -1705,9 +1703,7 @@ subtest "extra google analytics code displayed on email confirmation problem cre
$mech->content_contains( "'id': 'report/" . $report->id . "'", 'extra google code present' );
- $user->problems->delete;
- $user->alerts->delete;
- $user->delete;
+ $mech->delete_user($user);
};
};