Commit | Line | Data |
e37ad815 |
1 | #!perl\r |
2 | \r |
3 | use strict;\r |
4 | use warnings;\r |
5 | \r |
6 | use FindBin;\r |
7 | use lib "$FindBin::Bin/lib";\r |
8 | \r |
9 | use Test::More tests => 7;\r |
10 | use Catalyst::Test 'TestApp';\r |
11 | \r |
12 | # test getting a css file\r |
13 | ok( my $res = request('http://localhost/files/static.css'), 'request ok' );\r |
14 | is( $res->content_type, 'text/css', 'content-type text/css ok' );\r |
15 | like( $res->content, qr/background/, 'content of css ok' );\r |
16 | \r |
17 | # test a non-existent file\r |
18 | ok( $res = request('http://localhost/files/404.txt'), 'request ok' );\r |
19 | is( $res->content, 'default', 'default handler for non-existent content ok' );\r |
20 | \r |
21 | # test unknown extension\r |
22 | ok( $res = request('http://localhost/files/err.omg'), 'request ok' );\r |
23 | is( $res->content_type, 'text/plain', 'unknown extension as text/plain ok' );\r |