www2.0/t/basic.t

33 lines
801 B
Perl
Raw Normal View History

2021-12-10 17:02:42 -05:00
#!/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 = (
2021-12-10 18:45:59 -05:00
name => 'AliceTug',
2021-12-10 17:02:42 -05:00
location => 'Reston, VA',
message => 'Ayy... lmao'
);
2022-01-11 20:59:27 -05:00
# Routes
2021-12-10 17:02:42 -05:00
for my $route (@routes) {
$t->get_ok("/$route")->status_is(200)
}
2022-01-11 20:59:27 -05:00
2021-12-10 17:02:42 -05:00
# CGI Scripts
2022-01-11 20:59:27 -05:00
$t->get_ok('/cgi-bin/whoami.cgi')->status_is(200);
$t->get_ok('/cgi-bin/guest.cgi' )->status_is(302);
2021-12-10 17:02:42 -05:00
# ULA Tool
$t->get_ok('/ula6', form => {macaddr => 'ea:88:5e:3f:a3:34'})->status_is(200);
2022-01-05 21:31:31 -05:00
# Resume files
$t->get_ok('/resume/dbowling-resume.odt')->status_is(200);
$t->get_ok('/resume/dbowling-resume.docx')->status_is(200);
2021-12-10 17:02:42 -05:00
done_testing();