WrapCGI: implementing mst's suggestions
[catagits/Catalyst-Controller-WrapCGI.git] / t / cgibin.t
CommitLineData
21a20b7e 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin '$Bin';
7use lib "$Bin/lib";
8
9use Test::More tests => 4;
10
11use Catalyst::Test 'TestCGIBin';
12use HTTP::Request::Common;
13
c264816e 14my $response = request POST '/cgi-bin/path/test.pl', [
21a20b7e 15 foo => 'bar',
16 bar => 'baz'
17];
18
19is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File');
20
21$response = request POST '/cgihandler/dongs', [
22 foo => 'bar',
23 bar => 'baz'
24];
25
26is($response->content, 'foo:bar bar:baz',
27 'POST to Perl CGI File through a forward');
28
29$response = request POST '/cgihandler/mtfnpy', [
30 foo => 'bar',
31 bar => 'baz'
32];
33
34is($response->content, 'foo:bar bar:baz',
35 'POST to Perl CGI File through a forward via cgi_action');
36
37SKIP: {
38 skip "Can't run shell scripts on non-*nix", 1
39 if $^O eq 'MSWin32' || $^O eq 'VMS';
40
41 is(get('/cgi-bin/test.sh'), "Hello!\n", 'Non-Perl CGI File');
42}