->req->remote_user support, new release
[catagits/Catalyst-Controller-WrapCGI.git] / t / wrap-cgi.t
index 098ff5e..57f4ff9 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use FindBin '$Bin';
 use lib "$Bin/lib";
 
-use Test::More tests => 6;
+use Test::More tests => 7;
 
 use Catalyst::Test 'TestApp';
 use HTTP::Request::Common;
@@ -36,10 +36,11 @@ $response = request POST '/cgi-bin/test.cgi',
         'Content-Type' => 'text/plain',
         Content => 3
     ],
+    quux => [ undef, quux => Content => 4 ],
   ],
   'Content-Type' => 'form-data';
 
-is($response->content, 'foo:1 bar:2 baz:3', 'POST with file upload');
+is($response->content, 'foo:1 bar:2 baz:3 quux:4', 'POST with file upload');
 
 $response = request '/cgi-bin/test_pathinfo.cgi/path/%2Finfo';
 is($response->content, '/path/%2Finfo', 'PATH_INFO is correct');
@@ -48,6 +49,10 @@ $response = request '/cgi-bin/test_filepathinfo.cgi/path/%2Finfo';
 is($response->content, '/test_filepath_info/path/%2Finfo',
     'FILEPATH_INFO is correct (maybe)');
 
-$response = request '/cgi-bin/test_scriptname.cgi/foo/bar';
-is($response->content, '/cgi-bin/test_scriptname.cgi',
+$response = request '/cgi-bin/mtfnpy/test_scriptname.cgi/foo/bar';
+is($response->content, '/cgi-bin/mtfnpy/test_scriptname.cgi',
     'SCRIPT_NAME is correct');
+
+$ENV{REMOTE_USER} = 'TEST_USER';
+$response = request '/cgi-bin/test_remote_user.cgi';
+is($response->content, 'TEST_USER', 'REMOTE_USER was passed');