X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F05dirs.t;h=acb299e313f178a09ffa385a6f152027fec3c2ef;hb=0495a29318d1867ec261ad7eb40192fdb12383e7;hp=8fdeccaf89ae47ece1cf42af2f2bc58a90042216;hpb=c8ee8fd29adb4074cd205c6c7bc66a743eb80a53;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/t/05dirs.t b/t/05dirs.t index 8fdecca..acb299e 100644 --- a/t/05dirs.t +++ b/t/05dirs.t @@ -6,7 +6,7 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 10; +use Test::More tests => 13; use Catalyst::Test 'TestApp'; # test defined static dirs @@ -24,9 +24,10 @@ is( $res->content_type, 'text/plain', 'text/plain ok' ); ok( $res = request('http://localhost/always-static/test.html'), 'request ok' ); is( $res->code, 200, 'html file in dirs get served' ); -# a missing file in a defined static dir will return 404 +# a missing file in a defined static dir will return 404 and text/html ok( $res = request('http://localhost/always-static/404.txt'), 'request ok' ); is( $res->code, 404, '404 ok' ); +is( $res->content_type, 'text/html', '404 is text/html' ); # qr regex test ok( $res = request('http://localhost/images/catalyst.png'), 'request ok' ); @@ -35,3 +36,7 @@ is( $res->content_type, 'image/png', 'qr regex path ok' ); # eval regex test ok( $res = request('http://localhost/css/static.css'), 'request ok' ); like( $res->content, qr/background/, 'eval regex path ok' ); + +# A static dir with no trailing slash is handled by Cat +ok( $res = request('http://localhost/always-static'), 'request ok' ); +is( $res->content, 'default', 'content ok' ); \ No newline at end of file