X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F04static.t;fp=t%2F04static.t;h=edb897487f0acd5f316e3e3425fd0b9b9a735bae;hb=e37ad815c40f3cbde50ad12cd6b3ac68f0dc7399;hp=0000000000000000000000000000000000000000;hpb=51dca669391be4659883ffa73e4b09c677dab9c0;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/t/04static.t b/t/04static.t new file mode 100644 index 0000000..edb8974 --- /dev/null +++ b/t/04static.t @@ -0,0 +1,23 @@ +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/lib"; + +use Test::More tests => 7; +use Catalyst::Test 'TestApp'; + +# test getting a css file +ok( my $res = request('http://localhost/files/static.css'), 'request ok' ); +is( $res->content_type, 'text/css', 'content-type text/css ok' ); +like( $res->content, qr/background/, 'content of css ok' ); + +# test a non-existent file +ok( $res = request('http://localhost/files/404.txt'), 'request ok' ); +is( $res->content, 'default', 'default handler for non-existent content ok' ); + +# test unknown extension +ok( $res = request('http://localhost/files/err.omg'), 'request ok' ); +is( $res->content_type, 'text/plain', 'unknown extension as text/plain ok' );