Bugfix _dispatch_rest_method
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Catalyst / Action / REST / Controller / Actions.pm
CommitLineData
7656dd12 1package Test::Catalyst::Action::REST::Controller::Actions;
930013e6 2use Moose;
3use namespace::autoclean;
7656dd12 4
930013e6 5BEGIN { extends qw/Catalyst::Controller::REST/ }
7656dd12 6
5f461845 7__PACKAGE__->_action_class('Test::Action::Class');
7656dd12 8
9sub begin {} # Don't need serialization..
10
5f461845 11sub test : Local : ActionClass('+Catalyst::Action::REST') {
7656dd12 12 my ( $self, $c ) = @_;
5f461845 13 $c->res->header('X-Was-In-TopLevel', 1);
7656dd12 14}
15
5f461845 16sub test_GET : Private {
7656dd12 17 my ( $self, $c ) = @_;
5f461845 18 $c->res->body('GET');
7656dd12 19}
20
5f461845 21sub test_POST : Action {
7656dd12 22 my ( $self, $c ) = @_;
5f461845 23 $c->res->body('POST');
7656dd12 24}
25
5213846d 26sub test_PUT :ActionClass('+Test::Action::Class::Sub') {
7656dd12 27 my ( $self, $c ) = @_;
5f461845 28 $c->res->body('PUT');
7656dd12 29}
30
5f461845 31sub test_DELETE : Local {
7656dd12 32 my ( $self, $c ) = @_;
5f461845 33 $c->res->body('DELETE');
7656dd12 34}
35
5f461845 36sub test_OPTIONS : Path('foobar') {
7656dd12 37 my ( $self, $c ) = @_;
38
5f461845 39 $c->res->body('OPTIONS');
7656dd12 40}
41
3c4306f2 42sub other_test :Local :ActionClass('+Catalyst::Action::REST') {
43 my ( $self, $c ) = @_;
44 $c->res->header('X-Was-In-TopLevel', 1);
45}
46
47sub other_test_GET {
48 my ( $self, $c ) = @_;
49 $c->res->body('GET');
50}
51
52sub other_test_POST {
53 my ( $self, $c ) = @_;
54 $c->res->body('POST');
55}
56
57sub other_test_PUT :ActionClass('+Test::Action::Class::Sub') {
58 my ( $self, $c ) = @_;
59 $c->res->body('PUT');
60}
61
62sub other_test_DELETE {
63 my ( $self, $c ) = @_;
64 $c->res->body('DELETE');
65}
66
67sub other_test_OPTIONS {
68 my ( $self, $c ) = @_;
69
70 $c->res->body('OPTIONS');
71}
72
9e4398c8 73sub yet_other_test : Local : ActionClass('+Catalyst::Action::REST') {}
74
75sub yet_other_test_POST {
76 my ( $self, $c ) = @_;
77 $c->res->body('POST');
78}
79
7656dd12 80sub end : Private {} # Don't need serialization..
81
821;
83