1 package Test::Catalyst::Action::Serialize;
5 use lib ("$FindBin::Bin/../lib");
10 use Catalyst::Runtime '5.70';
15 name => 'Test::Catalyst::Action::Serialize',
17 'stash_key' => 'rest',
19 'text/x-yaml' => 'YAML',
20 'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
21 'text/broken' => 'Broken',
28 sub test :Local :ActionClass('Serialize') {
29 my ( $self, $c ) = @_;
30 $c->stash->{'rest'} = {
39 use Test::More tests => 3;
41 use Data::Dump qw(dump);
43 use lib ("$FindBin::Bin/lib", "$FindBin::Bin/../lib", "$FindBin::Bin/broken");
47 my $t = Test::Rest->new('content_type' => 'text/x-yaml');
49 use_ok 'Catalyst::Test', 'Test::Catalyst::Action::Serialize';
51 my $req = $t->get(url => '/test?content-type=text/x-yaml');
52 $req->remove_header('Content-Type');
53 my $res = request($req);
54 ok( $res->is_success, 'GET the serialized request succeeded' );
59 is( $res->content, $data, "Request returned proper data");