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 => 6;\r |
10 | use Catalyst::Test 'TestApp';\r |
11 | \r |
12 | # test altenate root dirs\r |
13 | TestApp->config->{static}->{include_path} = [\r |
14 | TestApp->config->{root} . '/overlay',\r |
15 | \&TestApp::incpath_generator,\r |
16 | TestApp->config->{root},\r |
17 | ];\r |
18 | \r |
19 | # test overlay dir\r |
20 | ok( my $res = request('http://localhost/overlay.jpg'), 'request ok' );\r |
21 | is( $res->content_type, 'image/jpeg', 'overlay path ok' );\r |
22 | \r |
23 | # test incpath_generator\r |
24 | ok( $res = request('http://localhost/incpath.css'), 'request ok' );\r |
25 | is( $res->content_type, 'text/css', 'incpath coderef ok' );\r |
26 | \r |
27 | # test passthrough to root\r |
28 | ok( $res = request('http://localhost/images/bad.gif'), 'request ok' );\r |
29 | is( $res->content_type, 'image/gif', 'root path ok' );\r |