Minor improvements
Updated TODO Enabled preloading Added defaultPSGI to WebGUI::Paths Added example of testing site via Plack::Test
This commit is contained in:
parent
f99f672b06
commit
5c70ffb3e0
7 changed files with 30 additions and 19 deletions
23
t/PSGI/default-site.t
Normal file
23
t/PSGI/default-site.t
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 4;
|
||||
|
||||
use Plack::Test;
|
||||
use Plack::Util;
|
||||
use HTTP::Request::Common;
|
||||
use WebGUI::Paths;
|
||||
|
||||
my $app = Plack::Util::load_psgi( WebGUI::Paths->defaultPSGI );
|
||||
|
||||
test_psgi $app, sub {
|
||||
my $cb = shift;
|
||||
|
||||
my $res = $cb->( GET "/" );
|
||||
is $res->code, 200;
|
||||
like $res->content, qr/My Company/;
|
||||
|
||||
$res = $cb->( GET "/?op=editSettings" );
|
||||
is $res->code, 401;
|
||||
like $res->content, qr/Administrative Function/;
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue