Add tests which should fail, but don't.
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Catalyst / Action / REST / Controller / REST.pm
CommitLineData
0ba73721 1package Test::Catalyst::Action::REST::Controller::REST;
2
930013e6 3use Moose;
4use namespace::autoclean;
0ba73721 5
930013e6 6BEGIN { extends 'Catalyst::Controller::REST' }
0ba73721 7
8sub test : Local {
9fb09119 9 my ( $self, $c ) = @_;
10 $self->status_ok( $c,
11 entity => { test => 'worked', data => $c->req->data } );
12}
13
14sub test_status_created : Local {
15 my ( $self, $c ) = @_;
16 $self->status_created(
17 $c,
18 location => '/rest',
19 entity => { status => 'created' }
20 );
21}
22
23sub test_status_accepted : Local {
24 my ( $self, $c ) = @_;
25 $self->status_accepted( $c, entity => { status => "queued", } );
26}
27
28sub test_status_no_content : Local {
29 my ( $self, $c ) = @_;
30 $self->status_no_content($c);
31}
32
33sub test_status_bad_request : Local {
34 my ( $self, $c ) = @_;
35 $self->status_bad_request( $c,
36 message => "Cannot do what you have asked!", );
37}
38
39sub test_status_not_found : Local {
40 my ( $self, $c ) = @_;
41 $self->status_not_found( $c,
42 message => "Cannot find what you were looking for!", );
43}
44
45sub test_status_gone : Local {
46 my ( $self, $c ) = @_;
47 $self->status_gone( $c,
48 message => "Document have been deleted by foo", );
0ba73721 49}
50
511;