Add deserialize_http_methods attribute to Catalyst::Action::Deserialize.
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Catalyst / Action / REST / Controller / Deserialize.pm
CommitLineData
c5c27d42 1package Test::Catalyst::Action::REST::Controller::Deserialize;
930013e6 2use Moose;
3use namespace::autoclean;
ffb4cc71 4
930013e6 5BEGIN { extends 'Catalyst::Controller' }
ffb4cc71 6
7__PACKAGE__->config(
588cbecc 8 'action_args' => {
9 'test_action_args' => {
10 'deserialize_http_methods' => [qw(POST PUT OPTIONS DELETE GET)]
11 }
12 },
ffb4cc71 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
22sub test :Local :ActionClass('Deserialize') {
23 my ( $self, $c ) = @_;
24 $c->res->output($c->req->data->{'kitty'});
25}
26
588cbecc 27sub test_action_args :Local :ActionClass('Deserialize') {
28 my ( $self, $c ) = @_;
29 $c->res->output($c->req->data->{'kitty'});
30}
31
ffb4cc71 321;