X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Fdata_handler.t;h=65af48a6eaee3eb90af33b366c52508b5a972073;hp=0d4af33b4961cf96bd94853196fcb48f12916162;hb=c63ec19d30f54b6fa44dff3e448108ab2e15ae84;hpb=b62c4f8b4b612b159ff6e02e350a818f6c6ee5c3 diff --git a/t/data_handler.t b/t/data_handler.t index 0d4af33..65af48a 100644 --- a/t/data_handler.t +++ b/t/data_handler.t @@ -7,6 +7,7 @@ use FindBin; use Test::More; use HTTP::Request::Common; use JSON::MaybeXS; +use Capture::Tiny qw/:all/; use lib "$FindBin::Bin/lib"; use Catalyst::Test 'TestDataHandlers'; @@ -30,5 +31,13 @@ ok my($res, $c) = ctx_request('/'); is $response->content, 'expected', 'expected content body'; } +{ + my $out; + local *STDERR; + open(STDERR, ">", \$out) or die "Can't open STDERR: $!"; + ok my $req = POST $c->uri_for_action('/test_nested_for'), 'Content-Type' => 'multipart/form-data', Content => { die => "a horrible death" }; + ok my $response = request $req; + is($out, "[error] multipart/form-data does not have an available data handler. Valid data_handlers are application/json, application/x-www-form-urlencoded.\n", 'yep we throw the slightly more usefull error'); +} done_testing;