Released Static::Simple 0.08 - Added tests for everything except Apache support
[catagits/Catalyst-Plugin-Static-Simple.git] / t / 04static.t
diff --git a/t/04static.t b/t/04static.t
new file mode 100644 (file)
index 0000000..edb8974
--- /dev/null
@@ -0,0 +1,23 @@
+#!perl\r
+\r
+use strict;\r
+use warnings;\r
+\r
+use FindBin;\r
+use lib "$FindBin::Bin/lib";\r
+\r
+use Test::More tests => 7;\r
+use Catalyst::Test 'TestApp';\r
+\r
+# test getting a css file\r
+ok( my $res = request('http://localhost/files/static.css'), 'request ok' );\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 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
+\r
+# test unknown extension\r
+ok( $res = request('http://localhost/files/err.omg'), 'request ok' );\r
+is( $res->content_type, 'text/plain', 'unknown extension as text/plain ok' );\r