Change configuration key to 'Plugin::Static::Simple' by default.
[catagits/Catalyst-Plugin-Static-Simple.git] / t / 06include_path.t
CommitLineData
ee1e7faf 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin;
7use lib "$FindBin::Bin/lib";
8
9use Test::More tests => 6;
10use Catalyst::Test 'TestApp';
11
12# test altenate root dirs
13TestApp->config->{'Plugin::Static::Simple'}->{include_path} = [
14 TestApp->config->{root} . '/overlay',
15 \&TestApp::incpath_generator,
16 TestApp->config->{root},
17];
18
19# test overlay dir
20ok( my $res = request('http://localhost/overlay.jpg'), 'request ok' );
21is( $res->content_type, 'image/jpeg', 'overlay path ok' );
22
23# test incpath_generator
24ok( $res = request('http://localhost/incpath.css'), 'request ok' );
25is( $res->content_type, 'text/css', 'incpath coderef ok' );
26
27# test passthrough to root
28ok( $res = request('http://localhost/images/bad.gif'), 'request ok' );
29is( $res->content_type, 'image/gif', 'root path ok' );