added test to address rt #36442
Eden Cardim [Sat, 15 Oct 2011 16:45:59 +0000 (16:45 +0000)]
t/decoded_content.t [new file with mode: 0644]
t/lib/Catty/Controller/Root.pm

diff --git a/t/decoded_content.t b/t/decoded_content.t
new file mode 100644 (file)
index 0000000..bedc77f
--- /dev/null
@@ -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');
index d7cb3b7..4d74605 100644 (file)
@@ -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;