v1.21
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Catalyst / Action / REST / Controller / Deserialize.pm
1 package Test::Catalyst::Action::REST::Controller::Deserialize;
2 use Moose;
3 use namespace::autoclean;
4
5 BEGIN { extends 'Catalyst::Controller' }
6
7 __PACKAGE__->config(
8     'action_args' => {
9         'test_action_args' => {
10             'deserialize_http_methods' => [qw(POST PUT OPTIONS DELETE GET)]
11         }
12     },
13     'stash_key' => 'rest',
14     'map'       => {
15         'text/x-yaml'        => 'YAML',
16         'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
17         'text/broken'        => 'Broken',
18     },
19 );
20
21
22 sub test :Local :ActionClass('Deserialize') {
23     my ( $self, $c ) = @_;
24     $c->res->output($c->req->data->{'kitty'});
25 }
26
27 sub test_action_args :Local :ActionClass('Deserialize') {
28     my ( $self, $c ) = @_;
29     $c->res->output($c->req->data->{'kitty'});
30 }
31
32 1;