Add tests which should fail, but don't.
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Catalyst / Action / REST / Controller / Serialize.pm
CommitLineData
74bc96b9 1package Test::Catalyst::Action::REST::Controller::Serialize;
2
930013e6 3use Moose;
4use namespace::autoclean;
5
6BEGIN { extends 'Catalyst::Controller' }
74bc96b9 7
8__PACKAGE__->config(
9 'default' => 'text/x-yaml',
10 'stash_key' => 'rest',
74bc96b9 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 ) = @_;
0d86eca6 28 # 'serialize_content_type' is configured in the test config in t/conf
74bc96b9 29 $c->stash->{'serialize_content_type'} = $c->req->params->{'serialize_content_type'};
30 $c->stash->{'rest'} = {
31 lou => 'is my cat',
32 };
33}
34
351;