X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcatalyst-action-serialize-accept.t;h=e843186f1cfb22a4177dffb98d9afc95c03ac982;hb=801ec3794e6db697855a04243e056c04cbc0aad2;hp=8b9408f19b9afa00ee91e786da51d4c6e557ae95;hpb=f10644864a543bf49bb2473c0809e376f9ec1fb4;p=catagits%2FCatalyst-Action-REST.git diff --git a/t/catalyst-action-serialize-accept.t b/t/catalyst-action-serialize-accept.t index 8b9408f..e843186 100644 --- a/t/catalyst-action-serialize-accept.t +++ b/t/catalyst-action-serialize-accept.t @@ -1,8 +1,8 @@ use strict; use warnings; -use Test::More tests => 16; -use Data::Serializer; +use Test::More; use FindBin; +use Test::Requires qw(YAML::Syck); use lib ("$FindBin::Bin/lib", "$FindBin::Bin/../lib", "$FindBin::Bin/broken"); use Test::Rest; @@ -73,19 +73,14 @@ SKIP: { is( $res->header('Content-type'), 'text/x-yaml', '... with expected content-type') } -# Make sure that when using content_type_stash_key, a valid value in the stash gets priority. -# This also tests that application-level config is properly passed to -# individual controllers; see t/lib/Test/Catalyst/Action/REST.pm +# Make sure that the default content type you specify really gets used. { - my $req = $t->get(url => - '/serialize/test_second?serialize_content_type=text/x-data-dumper' - ); + my $req = $t->get(url => '/override/test'); $req->remove_header('Content-Type'); - $req->header('Accept', '*/*'); my $res = request($req); ok( $res->is_success, 'GET the serialized request succeeded' ); - is( $res->content, "{'lou' => 'is my cat'}", "Request returned proper data"); - is( $res->header('Content-type'), 'text/x-data-dumper', '... with expected content-type') + is( $res->content, "--- \nlou: is my cat\n", "Request returned proper data"); } -1; +done_testing; +