X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fwrap-cgi.t;h=7c29988256466041002d5fc079bee8e7f543f91c;hb=d5bb451f3dca637593889125f913915dbc88d5a7;hp=2477c7d058a62694f6740397aeb7b1d5092ab788;hpb=0d83c5de80494ceb3f8bf7c39206b477d5f314e5;p=catagits%2FCatalyst-Controller-WrapCGI.git diff --git a/t/wrap-cgi.t b/t/wrap-cgi.t index 2477c7d..7c29988 100644 --- a/t/wrap-cgi.t +++ b/t/wrap-cgi.t @@ -6,7 +6,7 @@ use warnings; use FindBin '$Bin'; use lib "$Bin/lib"; -use Test::More tests => 2; +use Test::More tests => 6; use Catalyst::Test 'TestApp'; use HTTP::Request::Common; @@ -18,6 +18,31 @@ my $response = request POST '/cgi-bin/test.cgi', [ is($response->content, 'foo:bar bar:baz', 'POST to CGI'); -$response = request '/cgi-bin/test_pathinfo.cgi/path/info'; +$response = request POST '/cgi-bin/test.cgi', [ + foo => 'bar', + bar => 'baz', +], 'Content-Type' => 'form-data'; -is($response->content, '/path/info', 'PATH_INFO is correct'); +is($response->content, 'foo:bar bar:baz', 'POST to CGI (form-data)'); + +$response = request POST '/cgi-bin/test.cgi', + Content => [ + foo => 1, bar => 2, baz => [ undef, 'baz', Content => 3 ], + ], + 'Content-Type' => 'form-data'; + +{ + local $TODO = 'WrapCGI does not yet construct multipart/form-data requests'; + is($response->content, 'foo:1 bar:2 baz:3', 'POST with file upload'); +} + +$response = request '/cgi-bin/test_pathinfo.cgi/path/%2Finfo'; +is($response->content, '/path/%2Finfo', 'PATH_INFO is correct'); + +$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', + 'SCRIPT_NAME is correct');