File: 11serve_static.t

package info (click to toggle)
libcatalyst-plugin-static-simple-perl 0.36-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 384 kB
  • sloc: perl: 2,629; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/lib";

use Test::More tests => 6;
use Catalyst::Test 'TestApp';

# test getting a file via serve_static_file
ok( my $res = request('http://localhost/serve_static'), 'request ok' );
is( $res->code, 200, '200 ok' );
# .pm can be both application/x-pagemaker or text/x-perl, so only check for a slash
like( $res->content_type, qr{/}, 'content-type ok' );
like( $res->content, qr/package TestApp/, 'content of serve_static ok' );

# test getting a non-existant file via serve_static_file
ok( $res = request('http://localhost/serve_static_404'), 'request ok' );
is( $res->code, 404, '404 ok' );