Test whether incorrect passwords are rejected
This commit is contained in:
parent
4fb3d67f49
commit
64cbdddea8
|
@ -1,6 +1,6 @@
|
|||
use LWP::UserAgent;
|
||||
use JSON;
|
||||
use Test::Simple tests => 16;
|
||||
use Test::Simple tests => 17;
|
||||
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->cookie_jar({});
|
||||
|
@ -17,6 +17,9 @@ sub request_json {
|
|||
return $res;
|
||||
}
|
||||
|
||||
my $result = request_json({ uri => "/login", method => "POST", data => { username => "root", password => "wrong" } });
|
||||
ok($result->code() == 403, "Incorrect password rejected.");
|
||||
|
||||
my $result = request_json({ uri => "/login", method => "POST", data => { username => "root", password => "foobar" } });
|
||||
|
||||
my $user = decode_json($result->content());
|
||||
|
|
Loading…
Reference in a new issue