aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-10-31 15:38:50 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-10-31 15:38:50 +0000
commitf93bc85184077506c555e444c55abbeb1976f03e (patch)
treebe532d1919f1d0044a15caef8ffce2a3475609db /t/cobrand
parentc76880f3ce225df63cb8f712982177b8ca5b2d0e (diff)
parent3d593bc68d65015a50f8f4b1a6d9f818d8678226 (diff)
Merge branch '2fa-improvements'
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/fixmystreet.t22
1 files changed, 19 insertions, 3 deletions
diff --git a/t/cobrand/fixmystreet.t b/t/cobrand/fixmystreet.t
index a4d00d032..a54e782f2 100644
--- a/t/cobrand/fixmystreet.t
+++ b/t/cobrand/fixmystreet.t
@@ -111,6 +111,22 @@ FixMyStreet::override_config {
};
};
-END {
- done_testing();
-}
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'fixmystreet',
+}, sub {
+ subtest 'test enforced 2FA for superusers' => sub {
+ my $test_email = 'test@example.com';
+ my $user = FixMyStreet::DB->resultset('User')->find_or_create({ email => $test_email });
+ $user->password('password');
+ $user->is_superuser(1);
+ $user->update;
+
+ $mech->get_ok('/auth');
+ $mech->submit_form_ok(
+ { with_fields => { username => $test_email, password_sign_in => 'password' } },
+ "sign in using form" );
+ $mech->content_contains('requires two-factor');
+ };
+};
+
+done_testing();