23 lines
598 B
Perl
23 lines
598 B
Perl
#!/usr/bin/env perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
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);
|
|
|
|
$t->ua->max_redirects(0);
|
|
|
|
$t->get_ok('/view')->status_is(200)
|
|
->text_is(h2 => 'Messages from the World Wide Web');
|
|
$t->get_ok('/view/1')->status_is(200)
|
|
->text_is(h2 => 'Messages from the World Wide Web');
|
|
# Page shouldn't exist (unless Guestbook gets very popular!)
|
|
$t->get_ok('/view/1337')->status_is(404)
|
|
->text_is(h2 => 'Messages from the World Wide Web');
|
|
|
|
done_testing();
|