X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fengine-scgi.t;fp=t%2Fengine-scgi.t;h=b9e0a6ad1f7ce747f3efc668d0bca9d7d3bf45b7;hb=e069caf51a25bc0e2a82b874c7aa4655c1bba0d0;hp=0000000000000000000000000000000000000000;hpb=a07bd93d5e256cda6c11a049e6b450ccaaff747b;p=catagits%2FCatalyst-Engine-SCGI.git diff --git a/t/engine-scgi.t b/t/engine-scgi.t new file mode 100644 index 0000000..b9e0a6a --- /dev/null +++ b/t/engine-scgi.t @@ -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' + ); +}