X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTest%2FCatalyst%2FAction%2FREST%2FController%2FActions.pm;fp=t%2Flib%2FTest%2FCatalyst%2FAction%2FREST%2FController%2FActions.pm;h=596e4e0a9fba97c989f3e74664452b992aa2a6f4;hb=5f46184580aa24517de4f62eb65dd9a5275d4551;hp=2612a4eb963d1e0d728c965afa0128f037d75595;hpb=7eda8b409a03580ac0ab857f643d4c5231fb617e;p=catagits%2FCatalyst-Action-REST.git diff --git a/t/lib/Test/Catalyst/Action/REST/Controller/Actions.pm b/t/lib/Test/Catalyst/Action/REST/Controller/Actions.pm index 2612a4e..596e4e0 100644 --- a/t/lib/Test/Catalyst/Action/REST/Controller/Actions.pm +++ b/t/lib/Test/Catalyst/Action/REST/Controller/Actions.pm @@ -4,89 +4,39 @@ use warnings; use base qw/Catalyst::Controller::REST/; -__PACKAGE__->config( namespace => 'actions' ); +__PACKAGE__->_action_class('Test::Action::Class'); sub begin {} # Don't need serialization.. -sub test : Local : ActionClass('REST') { +sub test : Local : ActionClass('+Catalyst::Action::REST') { my ( $self, $c ) = @_; - $c->stash->{'entity'} = 'something'; + $c->res->header('X-Was-In-TopLevel', 1); } -sub test_GET : Private ActionClass('+Test::Action::Class') { +sub test_GET : Private { my ( $self, $c ) = @_; - - $c->stash->{'entity'} .= " GET"; - $c->forward('ok'); + $c->res->body('GET'); } -sub test_POST : Action ActionClass('+Test::Action::Class') { +sub test_POST : Action { my ( $self, $c ) = @_; - - $c->stash->{'entity'} .= " POST"; - $c->forward('ok'); + $c->res->body('POST'); } sub test_PUT :ActionClass('+Test::Action::Class') { my ( $self, $c ) = @_; - - $c->stash->{'entity'} .= " PUT"; - $c->forward('ok'); -} - -sub test_DELETE :ActionClass('+Test::Action::Class') { - my ( $self, $c ) = @_; - $c->stash->{'entity'} .= " DELETE"; - $c->forward('ok'); -} - -sub test_OPTIONS :ActionClass('+Test::Action::Class') { - my ( $self, $c ) = @_; - - $c->stash->{'entity'} .= " OPTIONS"; - $c->forward('ok'); + $c->res->body('PUT'); } -sub notreally : Local : ActionClass('REST') { -} - -sub notreally_GET :ActionClass('+Test::Action::Class') { - my ( $self, $c ) = @_; - - $c->stash->{'entity'} = "notreally GET"; - $c->forward('ok'); -} - -sub not_implemented : Local : ActionClass('REST') { -} - -sub not_implemented_GET :ActionClass('+Test::Action::Class') { - my ( $self, $c ) = @_; - - $c->stash->{'entity'} = "not_implemented GET"; - $c->forward('ok'); -} - -sub not_implemented_not_implemented :ActionClass('+Test::Action::Class') { - my ( $self, $c ) = @_; - - $c->stash->{'entity'} = "Not Implemented Handler"; - $c->forward('ok'); -} - -sub not_modified : Local : ActionClass('REST') { } - -sub not_modified_GET { +sub test_DELETE : Local { my ( $self, $c ) = @_; - $c->res->status(304); - return 1; + $c->res->body('DELETE'); } -sub ok : Private { +sub test_OPTIONS : Path('foobar') { my ( $self, $c ) = @_; - $c->res->content_type('text/plain'); - $c->res->body( $c->stash->{'entity'} ); + $c->res->body('OPTIONS'); } sub end : Private {} # Don't need serialization..