e9276b06b79f1cf1980eed0cf35df13ce38dfc83
[catagits/Catalyst-Plugin-Static-Simple.git] / t / 07mime_types.t
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 => 4;\r
10 use Catalyst::Test 'TestApp';\r
11 \r
12 # test custom MIME types\r
13 TestApp->config->{'Plugin::Static::Simple'}->{mime_types} = {\r
14     omg => 'holy/crap',\r
15     gif => 'patents/are-evil',\r
16 };\r
17 \r
18 ok( my $res = request('http://localhost/files/err.omg'), 'request ok' );\r
19 is( $res->content_type, 'holy/crap', 'custom MIME type ok' );\r
20 \r
21 ok( $res = request('http://localhost/files/bad.gif'), 'request ok' );\r
22 is( $res->content_type, 'patents/are-evil', 'custom MIME type overlay ok' );\r