X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-REST.git;a=blobdiff_plain;f=t%2Fcatalyst-action-serialize-query.t;h=cf04057b83c96380b0b84990aa5eb41e9fcccd6a;hp=c2378726cf059f64745a46558248133387eb780a;hb=960e29eed9ccd049c3c0dcd78a65308242a64ae0;hpb=6646fdc27add35e5421e516b1fcd98560bef0b96 diff --git a/t/catalyst-action-serialize-query.t b/t/catalyst-action-serialize-query.t index c237872..cf04057 100644 --- a/t/catalyst-action-serialize-query.t +++ b/t/catalyst-action-serialize-query.t @@ -1,44 +1,7 @@ -package Test::Catalyst::Action::Serialize; - -use FindBin; - -use lib ("$FindBin::Bin/../lib"); - -use strict; -use warnings; - -use Catalyst::Runtime '5.70'; - -use Catalyst; - -__PACKAGE__->config( - name => 'Test::Catalyst::Action::Serialize', - serialize => { - 'stash_key' => 'rest', - 'map' => { - 'text/x-yaml' => 'YAML', - 'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ], - 'text/broken' => 'Broken', - }, - } -); - -__PACKAGE__->setup; - -sub test :Local :ActionClass('Serialize') { - my ( $self, $c ) = @_; - $c->stash->{'rest'} = { - lou => 'is my cat', - }; -} - -package main; - use strict; use warnings; use Test::More tests => 3; use FindBin; -use Data::Dump qw(dump); use lib ("$FindBin::Bin/lib", "$FindBin::Bin/../lib", "$FindBin::Bin/broken"); use Test::Rest; @@ -46,9 +9,9 @@ use Test::Rest; # YAML my $t = Test::Rest->new('content_type' => 'text/x-yaml'); -use_ok 'Catalyst::Test', 'Test::Catalyst::Action::Serialize'; +use_ok 'Catalyst::Test', 'Test::Catalyst::Action::REST'; -my $req = $t->get(url => '/test?content-type=text/x-yaml'); +my $req = $t->get(url => '/serialize/test?content-type=text/x-yaml'); $req->remove_header('Content-Type'); my $res = request($req); ok( $res->is_success, 'GET the serialized request succeeded' );