refactored test application
[catagits/Catalyst-Action-Serialize-Data-Serializer.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',
10 'content_type_stash_key' => 'serialize_content_type',
11 'map' => {
12 'text/x-yaml' => 'YAML',
13 'application/json' => 'JSON',
14 'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
15 'text/broken' => 'Broken',
16 },
17);
18
19sub test :Local :ActionClass('Serialize') {
20 my ( $self, $c ) = @_;
21 $c->stash->{'rest'} = {
22 lou => 'is my cat',
23 };
24}
25
26sub test_second :Local :ActionClass('Serialize') {
27 my ( $self, $c ) = @_;
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;