X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpost.t;h=54e21c6fedf3003548de17ab6b76324b8bc0c5be;hb=4061606f304b183818e175a780c87c5612a5a0ed;hp=d7eeb1df66e9e55cd8b61b894741a59916ece9ac;hpb=9f3d2dd904535ac70f07f0189fd2e0f0c643812a;p=catagits%2FWeb-Simple.git 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' ]