From: Eden Cardim Date: Sat, 15 Oct 2011 16:45:59 +0000 (+0000) Subject: added test to address rt #36442 X-Git-Tag: 0.57~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FTest-WWW-Mechanize-Catalyst.git;a=commitdiff_plain;h=127272a78225898ecf6932cb9245d1637b2c20e3 added test to address rt #36442 --- diff --git a/t/decoded_content.t b/t/decoded_content.t new file mode 100644 index 0000000..bedc77f --- /dev/null +++ b/t/decoded_content.t @@ -0,0 +1,15 @@ +#!perl +use strict; +use warnings; +use lib 'lib'; +use Test::More tests => 2; +use lib 't/lib'; +use Test::WWW::Mechanize::Catalyst 'Catty'; + +my $root = "http://localhost"; + +my $m = Test::WWW::Mechanize::Catalyst->new; +$m->get_ok("$root/bad_content_encoding/"); + +# per https://rt.cpan.org/Ticket/Display.html?id=36442 +$m->content_contains('foo'); diff --git a/t/lib/Catty/Controller/Root.pm b/t/lib/Catty/Controller/Root.pm index d7cb3b7..4d74605 100644 --- a/t/lib/Catty/Controller/Root.pm +++ b/t/lib/Catty/Controller/Root.pm @@ -137,5 +137,12 @@ sub user_agent : Global { } +# per https://rt.cpan.org/Ticket/Display.html?id=36442 +sub bad_content_encoding :Global { + my($self, $c) = @_; + $c->res->content_encoding('duff'); + $c->res->body('foo'); +} + 1;