aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/auth.t
diff options
context:
space:
mode:
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;