From: Errietta Kostala Date: Mon, 26 Jan 2015 10:41:07 +0000 (+0000) Subject: Login - negative tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmaweb.git;a=commitdiff_plain;h=08e5e776de0bc06933de10d4ed8f84bc708c1b79 Login - negative tests --- diff --git a/t/04login.t b/t/04login.t index 2b9849f..5e2275d 100644 --- a/t/04login.t +++ b/t/04login.t @@ -32,4 +32,21 @@ $ua->content_contains('Stemmaweb - Logged in', 'Log in successful.'); my $content = $ua->get('/'); $ua->content_contains('Hello! user@example.org', 'We are logged in.'); +$ua->get('/logout'); +$ua->get('/login'); + +$ua->submit_form; + +$ua->content_contains('Your username is required.', 'Username is required to log in'); +$ua->content_contains('Your password is required.', 'Password is required to log in.'); + +$ua->submit_form( + fields => { + username => 'nonexistant', + password => 'nonexistant', + }); + +$ua->content_contains('Bad username or password.', 'Error is shown on incorrect details.'); + + done_testing;