From ab5f35bf8cee725a6e63c395c95f400f9a80be7e Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Thu, 15 Mar 2018 07:14:47 +0100 Subject: [PATCH] Update TOTP test (#1359) --- lemonldap-ng-portal/t/70-2F-TOTP.t | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lemonldap-ng-portal/t/70-2F-TOTP.t b/lemonldap-ng-portal/t/70-2F-TOTP.t index 4b09ca0fa..4d5b46ff4 100644 --- a/lemonldap-ng-portal/t/70-2F-TOTP.t +++ b/lemonldap-ng-portal/t/70-2F-TOTP.t @@ -3,7 +3,7 @@ use strict; use IO::String; require 't/test-lib.pm'; -my $maintests = 15; +my $maintests = 16; SKIP: { eval { require Convert::Base32 }; @@ -38,7 +38,16 @@ SKIP: { # TOTP form ok( $res = $client->_get( - '/totpregister.html', + '/2fregisters', + cookie => "lemonldap=$id", + accept => 'text/html', + ), + 'Form registration' + ); + expectRedirection( $res, qr#/2fregisters/totp$# ); + ok( + $res = $client->_get( + '/2fregisters/totp', cookie => "lemonldap=$id", accept => 'text/html', ), @@ -49,7 +58,7 @@ SKIP: { # JS query ok( $res = $client->_post( - '/totpregister/getkey', IO::String->new(''), + '/2fregisters/totp/getkey', IO::String->new(''), cookie => "lemonldap=$id", length => 0, ), @@ -71,7 +80,7 @@ SKIP: { my $s = "code=$code&token=$token"; ok( $res = $client->_post( - '/totpregister/verify', + '/2fregisters/totp/verify', IO::String->new($s), length => length($s), cookie => "lemonldap=$id",