X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcatalyst-action-rest.t;h=5ace0070be88c080077db27e4a6d18828e36db5e;hb=fec6d454787f6a7c23d1b6a7151a009a3ba0907b;hp=d2306627ca2bd3d4a214b69a64143ebeb757cc18;hpb=89b766ab4d711d370d06bd72526bd7ead8a19a57;p=catagits%2FCatalyst-Action-REST.git diff --git a/t/catalyst-action-rest.t b/t/catalyst-action-rest.t index d230662..5ace007 100644 --- a/t/catalyst-action-rest.t +++ b/t/catalyst-action-rest.t @@ -81,6 +81,15 @@ sub not_implemented_not_implemented { $c->forward('ok'); } +sub not_modified : Local : ActionClass('REST') { } + +sub not_modified_GET { + my ( $self, $c ) = @_; + $c->res->status(304); + return 1; +} + + sub ok : Private { my ( $self, $c ) = @_; @@ -92,7 +101,7 @@ package main; use strict; use warnings; -use Test::More qw(no_plan); +use Test::More tests => 17; use FindBin; use Data::Dump qw(dump); @@ -135,6 +144,9 @@ is( $options_res->code, 200, "OPTIONS request handler succeeded" ); is( $options_res->header('allow'), "GET", "OPTIONS request allow header properly set." ); +my $modified_res = request( $t->get( url => '/not_modified' ) ); +is( $modified_res->code, 304, "Not Modified request handler succeeded" ); + my $ni_res = request( $t->delete( url => '/not_implemented' ) ); is( $ni_res->code, 200, "Custom not_implemented handler succeeded" ); is(