Fix unit tests for new Captcha API (#2692)
New API does not differentiate between empty and wrong captcha
This commit is contained in:
parent
c6931ccb54
commit
aef1ebc348
|
@ -2,7 +2,7 @@ use Test::More;
|
||||||
use strict;
|
use strict;
|
||||||
use IO::String;
|
use IO::String;
|
||||||
use JSON;
|
use JSON;
|
||||||
use Lemonldap::NG::Portal::Main::Constants 'PE_CAPTCHAEMPTY';
|
use Lemonldap::NG::Portal::Main::Constants 'PE_CAPTCHAERROR';
|
||||||
|
|
||||||
require 't/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ SKIP: {
|
||||||
my $json;
|
my $json;
|
||||||
ok( $json = eval { from_json( $res->[2]->[0] ) }, 'Response is JSON' )
|
ok( $json = eval { from_json( $res->[2]->[0] ) }, 'Response is JSON' )
|
||||||
or print STDERR "$@\n" . Dumper($res);
|
or print STDERR "$@\n" . Dumper($res);
|
||||||
ok( $json->{error} == PE_CAPTCHAEMPTY, 'Response is PE_CAPTCHAEMPTY' )
|
ok( $json->{error} == PE_CAPTCHAERROR, 'Response is PE_CAPTCHAERROR' )
|
||||||
or explain( $json, "error => 77" );
|
or explain( $json, "error => 76" );
|
||||||
|
|
||||||
# Test normal first access
|
# Test normal first access
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user