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