Cherry pick everything bar the use parent change from 25d49c2, fixing RT#46680
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Catalyst / Action / REST / Controller / Serialize.pm
CommitLineData
74bc96b9 1package Test::Catalyst::Action::REST::Controller::Serialize;
2
3use strict;
4use warnings;
5use base 'Catalyst::Controller';
6
7__PACKAGE__->config(
8 'default' => 'text/x-yaml',
9 'stash_key' => 'rest',
74bc96b9 10 'map' => {
11 'text/x-yaml' => 'YAML',
12 'application/json' => 'JSON',
13 'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
14 'text/broken' => 'Broken',
15 },
16);
17
18sub test :Local :ActionClass('Serialize') {
19 my ( $self, $c ) = @_;
20 $c->stash->{'rest'} = {
21 lou => 'is my cat',
22 };
23}
24
25sub test_second :Local :ActionClass('Serialize') {
26 my ( $self, $c ) = @_;
0d86eca6 27 # 'serialize_content_type' is configured in the test config in t/conf
74bc96b9 28 $c->stash->{'serialize_content_type'} = $c->req->params->{'serialize_content_type'};
29 $c->stash->{'rest'} = {
30 lou => 'is my cat',
31 };
32}
33
341;