guestbook-ng/t/spam.t

23 lines
598 B
Perl
Raw Normal View History

2021-12-04 08:06:03 +00:00
#!/usr/bin/env perl
2021-12-19 04:46:20 +00:00
use strict;
use warnings;
2021-12-04 08:06:03 +00: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-12 00:01:43 +00:00
2022-04-08 17:47:33 +00:00
$t->ua->max_redirects(0);
2022-01-09 03:01:51 +00:00
2022-01-12 20:18:34 +00:00
$t->get_ok('/spam')->status_is(200)
->text_is(h2 => 'Messages from the World Wide Web');
2022-04-08 17:47:33 +00:00
$t->get_ok('/spam/1')->status_is(200)
->text_is(h2 => 'Messages from the World Wide Web');
2022-04-08 19:56:06 +00: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 08:06:03 +00:00
done_testing();