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