guestbook-ng/t/spam.t

23 lines
598 B
Perl
Raw Normal View History

2021-12-04 03:06:03 -05:00
#!/usr/bin/env perl
2021-12-18 23:46:20 -05:00
use strict;
use warnings;
2021-12-04 03:06:03 -05:00
use Test::More;
use Mojo::File qw{curfile};
use Test::Mojo;
my $script = curfile->dirname->sibling('guestbook-ng.pl');
my $t = Test::Mojo->new($script);
2021-12-11 19:01:43 -05:00
2022-04-08 13:47:33 -04:00
$t->ua->max_redirects(0);
2022-01-08 22:01:51 -05:00
2022-01-12 15:18:34 -05:00
$t->get_ok('/spam')->status_is(200)
->text_is(h2 => 'Messages from the World Wide Web');
2022-04-08 13:47:33 -04:00
$t->get_ok('/spam/1')->status_is(200)
->text_is(h2 => 'Messages from the World Wide Web');
2022-04-08 15:56:06 -04:00
# Page shouldn't exist (unless Guestbook gets very popular!)
$t->get_ok('/spam/1337')->status_is(404)
->text_is(h2 => 'Messages from the World Wide Web');
2021-12-04 03:06:03 -05:00
done_testing();