From a7b222917f576ce39bb76aff784177eed68b8e9b Mon Sep 17 00:00:00 2001 From: swag Date: Sat, 18 Dec 2021 23:42:20 -0500 Subject: [PATCH] Make tests more granular --- t/basic.t | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/basic.t b/t/basic.t index 13e1dbe..1f50c6b 100644 --- a/t/basic.t +++ b/t/basic.t @@ -8,13 +8,13 @@ my $script = curfile->dirname->sibling('guestbook-ng.pl'); my $t = Test::Mojo->new($script); my %form = ( name => 'swagg boi', - message => 'Ayy... lmao' + message => 'Ayy... lmao', + answer => 0 ); -$t->ua->max_redirects(10); - -$t->get_ok('/')->status_is(200); -$t->get_ok('/sign')->status_is(200); -$t->post_ok('/sign', form => \%form)->status_is(200); +$t->get_ok('/')->status_is(200) + ->text_is('h2', 'Messages from the World Wide Web'); +$t->get_ok('/sign')->status_is(200)->text_is('h2', 'Sign the Guestbook'); +$t->post_ok('/sign', form => \%form)->status_is(302); done_testing();