X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-Serialize-Data-Serializer.git;a=blobdiff_plain;f=t%2Flib%2FTest%2FCatalyst%2FAction%2FREST%2FController%2FREST.pm;fp=t%2Flib%2FTest%2FCatalyst%2FAction%2FREST%2FController%2FREST.pm;h=0000000000000000000000000000000000000000;hp=c91c42f1e2ad8e3ed27a4692b8a3b6316a2bf689;hb=79025f72c27ba313b3c701cee238f84166f32f9e;hpb=f10c7e1c7eb3b4cb10401dbb86ca8db3dc38ced2 diff --git a/t/lib/Test/Catalyst/Action/REST/Controller/REST.pm b/t/lib/Test/Catalyst/Action/REST/Controller/REST.pm deleted file mode 100644 index c91c42f..0000000 --- a/t/lib/Test/Catalyst/Action/REST/Controller/REST.pm +++ /dev/null @@ -1,93 +0,0 @@ -package Test::Catalyst::Action::REST::Controller::REST; - -use Moose; -use namespace::autoclean; - -BEGIN { extends 'Catalyst::Controller::REST' } - -sub test : Local { - my ( $self, $c ) = @_; - $self->status_ok( $c, - entity => { test => 'worked', data => $c->req->data } ); -} - -sub test_status_created : Local { - my ( $self, $c ) = @_; - $self->status_created( - $c, - location => '/rest', - entity => { status => 'created' } - ); -} - -sub test_status_multiple_choices : Local { - my ( $self, $c ) = @_; - $self->status_multiple_choices( - $c, - location => '/rest/choice1', - entity => { choices => [qw(/rest/choice1 /rest/choice2)] } - ); -} - -sub test_status_found : Local { - my ( $self, $c ) = @_; - $self->status_found( - $c, - location => '/rest', - entity => { status => 'found' }, - ); -} - -sub test_status_accepted : Local { - my ( $self, $c ) = @_; - $self->status_accepted( - $c, - location => '/rest', - entity => { status => "queued", } - ); -} - -sub test_status_no_content : Local { - my ( $self, $c ) = @_; - $self->status_no_content($c); -} - -sub test_status_bad_request : Local { - my ( $self, $c ) = @_; - $self->status_bad_request( $c, - message => "Cannot do what you have asked!", ); -} - -sub test_status_forbidden : Local { - my ( $self, $c ) = @_; - $self->status_forbidden ( $c, - message => "access denied", ); -} - -sub test_status_not_found : Local { - my ( $self, $c ) = @_; - $self->status_not_found( $c, - message => "Cannot find what you were looking for!", ); -} - -sub test_status_gone : Local { - my ( $self, $c ) = @_; - $self->status_gone( $c, - message => "Document have been deleted by foo", ); -} - -sub opts : Local ActionClass('REST') {} - -sub opts_GET { - my ( $self, $c ) = @_; - $self->status_ok( $c, entity => { opts => 'worked' } ); -} - -sub opts_not_implemented { - my ( $self, $c ) = @_; - $c->res->status(405); - $c->res->header('Allow' => [qw(GET HEAD)]); - $c->res->body('Not implemented'); -} - -1;