Remove overridden prepare_path that was mangling the applicaiton prefix
[catagits/Catalyst-Engine-SCGI.git] / t / engine-scgi.t
diff --git a/t/engine-scgi.t b/t/engine-scgi.t
new file mode 100644 (file)
index 0000000..b9e0a6a
--- /dev/null
@@ -0,0 +1,29 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+use_ok('Catalyst');
+
+scgi_application_prefix: {
+    my $request = Catalyst::Request->new;
+
+    $ENV{HTTP_HOST} = "127.0.0.1";
+    $ENV{SERVER_PORT} = 80;
+    $ENV{SCRIPT_NAME} = '/MyApp';
+    $ENV{PATH_INFO} = '/some/path';
+
+    my $c = Catalyst->new({
+      request => $request,
+    });
+    $c->setup_engine('SCGI');
+    $c->prepare_path;
+
+    is (
+        Catalyst::uri_for( $c, '/some/path' )->as_string,
+        'http://127.0.0.1/MyApp/some/path',
+        'uri_for creates url with correct application prefix'
+    );
+}