Unit test for #2430
This commit is contained in:
parent
5ed0677d35
commit
fdbe713e1f
|
@ -15,6 +15,9 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
passwordDB => 'Demo',
|
passwordDB => 'Demo',
|
||||||
portalRequireOldPassword => 1,
|
portalRequireOldPassword => 1,
|
||||||
showLanguages => 0,
|
showLanguages => 0,
|
||||||
|
storePassword => 1,
|
||||||
|
restSessionServer => 1,
|
||||||
|
restExportSecretKeys => 1,
|
||||||
error_de_85 => 'From lemonlap-ng.ini',
|
error_de_85 => 'From lemonlap-ng.ini',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,6 +121,28 @@ ok( $json->{error} == PE_BADOLDPASSWORD, 'Response is PE_BADOLDPASSWORD' )
|
||||||
or explain( $json, "error => 27" );
|
or explain( $json, "error => 27" );
|
||||||
count(3);
|
count(3);
|
||||||
|
|
||||||
|
# Test good password
|
||||||
|
ok(
|
||||||
|
$res = $client->_post(
|
||||||
|
'/',
|
||||||
|
IO::String->new(
|
||||||
|
'oldpassword=dwho&newpassword=test&confirmpassword=test'),
|
||||||
|
cookie => "lemonldap=$id",
|
||||||
|
accept => 'application/json',
|
||||||
|
length => 54
|
||||||
|
),
|
||||||
|
'Correct password'
|
||||||
|
);
|
||||||
|
count(1);
|
||||||
|
|
||||||
|
expectReject( $res, 200, 35, "Expect PE_PASSWORD_OK" );
|
||||||
|
|
||||||
|
# Check updated password in session (#2430)
|
||||||
|
my $json =
|
||||||
|
expectJSON( $client->_get("/sessions/global/$id"), 'Get session content' );
|
||||||
|
is( $json->{_password}, "test", "password updated in session" );
|
||||||
|
count(1);
|
||||||
|
|
||||||
# Test $client->logout
|
# Test $client->logout
|
||||||
$client->logout($id);
|
$client->logout($id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue