From: Hans Dieter Pearcey Date: Wed, 25 Mar 2009 05:37:24 +0000 (-0400) Subject: failing test for RT#43840 X-Git-Tag: 0.67_01~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-REST.git;a=commitdiff_plain;h=0d86eca689a3c82e604464aafd6984e2f908b7e4 failing test for RT#43840 --- diff --git a/t/catalyst-action-serialize-accept.t b/t/catalyst-action-serialize-accept.t index 836a8e8..f9e2426 100644 --- a/t/catalyst-action-serialize-accept.t +++ b/t/catalyst-action-serialize-accept.t @@ -74,6 +74,8 @@ SKIP: { } # Make that 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 { my $req = $t->get(url => '/serialize/test_second?serialize_content_type=text/x-data-dumper' diff --git a/t/lib/Test/Catalyst/Action/REST.pm b/t/lib/Test/Catalyst/Action/REST.pm index 70414ec..dbc6039 100644 --- a/t/lib/Test/Catalyst/Action/REST.pm +++ b/t/lib/Test/Catalyst/Action/REST.pm @@ -6,9 +6,14 @@ use warnings; use Catalyst::Runtime '5.70'; use Catalyst; +use FindBin; __PACKAGE__->config( name => 'Test::Catalyst::Action::REST', + # RT#43840 -- this was ignored in 0.66 and earlier + 'Controller::Serialize' => { + content_type_stash_key => 'serialize_content_type', + }, ); __PACKAGE__->setup; diff --git a/t/lib/Test/Catalyst/Action/REST/Controller/Serialize.pm b/t/lib/Test/Catalyst/Action/REST/Controller/Serialize.pm index c4111da..4894c02 100644 --- a/t/lib/Test/Catalyst/Action/REST/Controller/Serialize.pm +++ b/t/lib/Test/Catalyst/Action/REST/Controller/Serialize.pm @@ -7,7 +7,6 @@ use base 'Catalyst::Controller'; __PACKAGE__->config( 'default' => 'text/x-yaml', 'stash_key' => 'rest', - 'content_type_stash_key' => 'serialize_content_type', 'map' => { 'text/x-yaml' => 'YAML', 'application/json' => 'JSON', @@ -25,6 +24,7 @@ sub test :Local :ActionClass('Serialize') { sub test_second :Local :ActionClass('Serialize') { my ( $self, $c ) = @_; + # 'serialize_content_type' is configured in the test config in t/conf $c->stash->{'serialize_content_type'} = $c->req->params->{'serialize_content_type'}; $c->stash->{'rest'} = { lou => 'is my cat',