Make tests more granular

This commit is contained in:
swag 2021-12-18 23:42:20 -05:00
parent 42f3c31e85
commit a7b222917f

View File

@ -8,13 +8,13 @@ my $script = curfile->dirname->sibling('guestbook-ng.pl');
my $t = Test::Mojo->new($script); my $t = Test::Mojo->new($script);
my %form = ( my %form = (
name => 'swagg boi', name => 'swagg boi',
message => 'Ayy... lmao' message => 'Ayy... lmao',
answer => 0
); );
$t->ua->max_redirects(10); $t->get_ok('/')->status_is(200)
->text_is('h2', 'Messages from the World Wide Web');
$t->get_ok('/')->status_is(200); $t->get_ok('/sign')->status_is(200)->text_is('h2', 'Sign the Guestbook');
$t->get_ok('/sign')->status_is(200); $t->post_ok('/sign', form => \%form)->status_is(302);
$t->post_ok('/sign', form => \%form)->status_is(200);
done_testing(); done_testing();