lemonldap-ng-common/t/10-PSGI.t
raw| 1 | use Test::More; |
| 2 | use t::TestPsgi; |
| 3 | use Plack::Test; |
| 4 | use HTTP::Request; |
| 5 | |
| 6 | subtest "Check successful init" => sub { |
| 7 | my $server = Plack::Test->create( t::TestPsgi->run( {} ) ); |
| 8 | |
| 9 | my $req = HTTP::Request->new( GET => "/" ); |
| 10 | $req->header( Accept => "text/html" ); |
| 11 | my $res = $server->request($req); |
| 12 | is( $res->code, 200, "Returned HTTP code 200" ); |
| 13 | like( $res->content, qr/Body lines/, "Found expected message in body" ); |
| 14 | }; |
| 15 | |
| 16 | done_testing(); |