Static::Simple 0.20, fixed static dirs regex and added content-type text/html to...
[catagits/Catalyst-Plugin-Static-Simple.git] / t / 05dirs.t
index 8fdecca..acb299e 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use FindBin;\r
 use lib "$FindBin::Bin/lib";\r
 \r
-use Test::More tests => 10;\r
+use Test::More tests => 13;\r
 use Catalyst::Test 'TestApp';\r
 \r
 # test defined static dirs\r
@@ -24,9 +24,10 @@ is( $res->content_type, 'text/plain', 'text/plain ok' );
 ok( $res = request('http://localhost/always-static/test.html'), 'request ok' );\r
 is( $res->code, 200, 'html file in dirs get served' );\r
 \r
-# a missing file in a defined static dir will return 404\r
+# a missing file in a defined static dir will return 404 and text/html\r
 ok( $res = request('http://localhost/always-static/404.txt'), 'request ok' );\r
 is( $res->code, 404, '404 ok' );\r
+is( $res->content_type, 'text/html', '404 is text/html' );\r
 \r
 # qr regex test\r
 ok( $res = request('http://localhost/images/catalyst.png'), 'request ok' );\r
@@ -35,3 +36,7 @@ is( $res->content_type, 'image/png', 'qr regex path ok' );
 # eval regex test\r
 ok( $res = request('http://localhost/css/static.css'), 'request ok' );\r
 like( $res->content, qr/background/, 'eval regex path ok' );\r
+\r
+# A static dir with no trailing slash is handled by Cat\r
+ok( $res = request('http://localhost/always-static'), 'request ok' );\r
+is( $res->content, 'default', 'content ok' );
\ No newline at end of file