add failing test (for private action)
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Catalyst / Action / REST / Controller / Actions.pm
CommitLineData
7656dd12 1package Test::Catalyst::Action::REST::Controller::Actions;
2use strict;
3use warnings;
4
5use base qw/Catalyst::Controller::REST/;
6
7__PACKAGE__->config( namespace => 'actions' );
8
9sub begin {} # Don't need serialization..
10
11sub test : Local : ActionClass('REST') {
12 my ( $self, $c ) = @_;
13 $c->stash->{'entity'} = 'something';
14}
15
07b2ce27 16sub test_GET : Private ActionClass('+Test::Action::Class') {
7656dd12 17 my ( $self, $c ) = @_;
18
19 $c->stash->{'entity'} .= " GET";
20 $c->forward('ok');
21}
22
23sub test_POST :ActionClass('+Test::Action::Class') {
24 my ( $self, $c ) = @_;
25
26 $c->stash->{'entity'} .= " POST";
27 $c->forward('ok');
28}
29
30sub test_PUT :ActionClass('+Test::Action::Class') {
31 my ( $self, $c ) = @_;
32
33 $c->stash->{'entity'} .= " PUT";
34 $c->forward('ok');
35}
36
37sub test_DELETE :ActionClass('+Test::Action::Class') {
38 my ( $self, $c ) = @_;
39 $c->stash->{'entity'} .= " DELETE";
40 $c->forward('ok');
41}
42
43sub test_OPTIONS :ActionClass('+Test::Action::Class') {
44 my ( $self, $c ) = @_;
45
46 $c->stash->{'entity'} .= " OPTIONS";
47 $c->forward('ok');
48}
49
50sub notreally : Local : ActionClass('REST') {
51}
52
53sub notreally_GET :ActionClass('+Test::Action::Class') {
54 my ( $self, $c ) = @_;
55
56 $c->stash->{'entity'} = "notreally GET";
57 $c->forward('ok');
58}
59
60sub not_implemented : Local : ActionClass('REST') {
61}
62
63sub not_implemented_GET :ActionClass('+Test::Action::Class') {
64 my ( $self, $c ) = @_;
65
66 $c->stash->{'entity'} = "not_implemented GET";
67 $c->forward('ok');
68}
69
70sub not_implemented_not_implemented :ActionClass('+Test::Action::Class') {
71 my ( $self, $c ) = @_;
72
73 $c->stash->{'entity'} = "Not Implemented Handler";
74 $c->forward('ok');
75}
76
77sub not_modified : Local : ActionClass('REST') { }
78
79sub not_modified_GET {
80 my ( $self, $c ) = @_;
81 $c->res->status(304);
82 return 1;
83}
84
85sub ok : Private {
86 my ( $self, $c ) = @_;
87
88 $c->res->content_type('text/plain');
89 $c->res->body( $c->stash->{'entity'} );
90}
91
92sub end : Private {} # Don't need serialization..
93
941;
95