31 lines
747 B
Perl
31 lines
747 B
Perl
|
#!/usr/bin/env perl
|
||
|
|
||
|
use Test::More;
|
||
|
use Mojo::File qw{curfile};
|
||
|
use Test::Mojo;
|
||
|
|
||
|
my $script = curfile->dirname->sibling('www-swagg.pl');
|
||
|
my $t = Test::Mojo->new($script);
|
||
|
my @routes = ('', 'ula6', 'die', 'me', 'news', 'portal');
|
||
|
my %guest_form = (
|
||
|
name => 'AliceTug',
|
||
|
location => 'Reston, VA',
|
||
|
message => 'Ayy... lmao'
|
||
|
);
|
||
|
|
||
|
# GET Requests
|
||
|
for my $route (@routes) {
|
||
|
$t->get_ok("/$route")->status_is(200)
|
||
|
}
|
||
|
# CGI Scripts
|
||
|
for my $script (qw{guest whoami}) {
|
||
|
$t->get_ok("/cgi-bin/$script.cgi")->status_is(200)
|
||
|
}
|
||
|
# ULA Tool
|
||
|
$t->get_ok('/ula6', form => {macaddr => 'ea:88:5e:3f:a3:34'})->status_is(200);
|
||
|
|
||
|
# POST Requests
|
||
|
$t->post_ok('/cgi-bin/guest.cgi', form => \%guest_form)->status_is(200);
|
||
|
|
||
|
done_testing();
|