From: Wallace Reis Date: Fri, 22 Jun 2012 11:26:50 +0000 (+0200) Subject: Add failing tests for default HEAD dispatch X-Git-Tag: 1.03~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-REST.git;a=commitdiff_plain;h=ecb598eff7eefd9ad9a113303e2c6f578a12a3b4 Add failing tests for default HEAD dispatch --- diff --git a/t/catalyst-action-rest-action-dispatch.t b/t/catalyst-action-rest-action-dispatch.t index 0f1e60e..8d01398 100644 --- a/t/catalyst-action-rest-action-dispatch.t +++ b/t/catalyst-action-rest-action-dispatch.t @@ -45,6 +45,11 @@ foreach my $endpoint (qw/ test other_test /) { } } +my $head_res = request( $t->head(url => '/actions/test') ); +ok($head_res->is_success, 'HEAD request succeeded') + or diag($head_res->code); +ok(!$head_res->content, 'HEAD request had proper response'); + my $res = request( $t->put( url => '/actions/test', diff --git a/t/catalyst-action-rest.t b/t/catalyst-action-rest.t index 324df80..c7f23a4 100644 --- a/t/catalyst-action-rest.t +++ b/t/catalyst-action-rest.t @@ -33,6 +33,11 @@ foreach my $method (qw(GET DELETE POST PUT OPTIONS)) { ); } +my $head_res = request( $t->head(url => '/test') ); +ok($head_res->is_success, 'HEAD request succeeded') + or diag($head_res->code); +ok(!$head_res->content, 'HEAD request had proper response'); + my $fail_res = request( $t->delete( url => '/notreally' ) ); is( $fail_res->code, 405, "Request to bad method gets 405 Not Implemented" ); is( $fail_res->header('allow'), "GET", "405 allow header properly set." );