aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/auth.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2019-10-30 19:28:55 +0100
committerMarius Halden <marius.h@lden.org>2019-10-30 19:28:55 +0100
commit377bd96aab7cad3434185c30eb908c9da447fe40 (patch)
tree7ec5527e205d5b62caaa862a7de8cd25199c8bf0 /t/app/controller/auth.t
parent56f61b1441070aa0b9ddcfc74aca46c20313609f (diff)
parent92b253904062edd533e55c22824de6fd01e2f7c1 (diff)
Merge tag 'v2.6' into fiksgatami-dev
Diffstat (limited to 't/app/controller/auth.t')
-rw-r--r--t/app/controller/auth.t39
1 files changed, 11 insertions, 28 deletions
diff --git a/t/app/controller/auth.t b/t/app/controller/auth.t
index 8cc7e4154..ffabc75f3 100644
--- a/t/app/controller/auth.t
+++ b/t/app/controller/auth.t
@@ -100,33 +100,6 @@ $mech->not_logged_in_ok;
$mech->log_out_ok;
}
-foreach my $remember_me ( '1', '0' ) {
- subtest "sign in using valid details (remember_me => '$remember_me')" => sub {
- $mech->get_ok('/auth');
- $mech->submit_form_ok(
- {
- form_name => 'general_auth',
- fields => {
- username => $test_email,
- password_sign_in => $test_password,
- remember_me => ( $remember_me ? 1 : undef ),
- },
- button => 'sign_in_by_password',
- },
- "sign in with '$test_email' & '$test_password'"
- );
- is $mech->uri->path, '/my', "redirected to correct page";
-
- my $expiry = $mech->session_cookie_expiry;
- $remember_me
- ? cmp_ok( $expiry, '>', 86400, "long expiry time" )
- : is( $expiry, 0, "no expiry time" );
-
- # logout
- $mech->log_out_ok;
- };
-}
-
# try to sign in with bad details
$mech->get_ok('/auth');
$mech->submit_form_ok(
@@ -278,7 +251,7 @@ subtest "check logging in with token" => sub {
};
subtest 'check password length/common' => sub {
- $mech->get_ok('/auth');
+ $mech->get_ok('/auth/create');
$mech->submit_form_ok({
form_name => 'general_auth',
fields => { username => $test_email, password_register => 'short' },
@@ -300,6 +273,16 @@ subtest 'check common password AJAX call' => sub {
$mech->content_contains("true");
};
+subtest 'test forgotten password page' => sub {
+ $mech->get_ok('/auth/forgot');
+ $mech->content_contains('Forgot password');
+ $mech->submit_form_ok({
+ form_name => 'general_auth',
+ fields => { username => $test_email, password_register => 'squirblewirble' },
+ button => 'sign_in_by_code',
+ });
+};
+
subtest "Test two-factor authentication login" => sub {
use Auth::GoogleAuth;
my $auth = Auth::GoogleAuth->new;