Commit | Line | Data |
21a20b7e |
1 | #!perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use FindBin '$Bin'; |
7 | use lib "$Bin/lib"; |
8 | |
9 | use Test::More tests => 4; |
10 | |
11 | use Catalyst::Test 'TestCGIBin'; |
12 | use HTTP::Request::Common; |
13 | |
14 | my $response = request POST '/cgi-bin/test.pl', [ |
15 | foo => 'bar', |
16 | bar => 'baz' |
17 | ]; |
18 | |
19 | is($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 | |
26 | is($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 | |
34 | is($response->content, 'foo:bar bar:baz', |
35 | 'POST to Perl CGI File through a forward via cgi_action'); |
36 | |
37 | SKIP: { |
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 | } |