use FindBin;\r
use lib "$FindBin::Bin/lib";\r
\r
-use Test::More tests => 7;\r
+# Module::Build craps out on files with spaces so it's not included in the dist\r
+my $has_space_file = -e "$FindBin::Bin/lib/TestApp/root/files/space file.txt";\r
+\r
+use Test::More;\r
+plan tests => ($has_space_file) ? 10 : 7;\r
use Catalyst::Test 'TestApp';\r
\r
# test getting a css file\r
is( $res->content_type, 'text/css', 'content-type text/css ok' );\r
like( $res->content, qr/background/, 'content of css ok' );\r
\r
+# test a file with spaces\r
+if ( $has_space_file ) {\r
+ ok( $res = request('http://localhost/files/space file.txt'), 'request ok' );\r
+ is( $res->content_type, 'text/plain', 'content-type text/plain ok' );\r
+ like( $res->content, qr/background/, 'content of space file ok' );\r
+}\r
+\r
# test a non-existent file\r
ok( $res = request('http://localhost/files/404.txt'), 'request ok' );\r
is( $res->content, 'default', 'default handler for non-existent content ok' );\r