From: Arthur Axel 'fREW' Schmidt Date: Wed, 18 Sep 2013 17:20:40 +0000 (-0500) Subject: test POST splat X-Git-Tag: v0.021~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Simple.git;a=commitdiff_plain;h=24ecd3bd2cf188c1909b62228a55dd6b5eca3d2e test POST splat --- diff --git a/t/post.t b/t/post.t index d7eeb1d..54e21c6 100644 --- a/t/post.t +++ b/t/post.t @@ -20,6 +20,13 @@ use Test::More qw(no_plan); [ $_[1]->reason || $_[1]->filename ], ] }, + sub (POST + %* + %biff=) { + $_[1]->{bar} ||= 'EMPTY'; + [ 200, + [ "Content-type" => "text/plain" ], + [ join(' ',@{$_[1]}{qw(biff bong)}) ] + ] + }, } } @@ -67,6 +74,19 @@ cmp_ok($upload->code, '==', 200, '200 with multipart'); is($upload->content, 'FOO BAR', 'both params returned'); +my $upload_splat = run_request( + POST 'http://localhost' + => Content_Type => 'form-data' + => Content => [ + biff => 'frew', + bong => 'fru' + ] +); + +cmp_ok($upload_splat->code, '==', 200, '200 with multipart'); + +is($upload_splat->content, 'frew fru', 'both params returned'); + my $upload_wrongtype = run_request( POST 'http://localhost' => [ baz => 'fleem' ]