From: Eden Cardim Date: Wed, 4 Apr 2012 12:22:50 +0000 (+0000) Subject: adding utf8 redirection test X-Git-Tag: 0.57~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FTest-WWW-Mechanize-Catalyst.git;a=commitdiff_plain;h=74649ca9f02a76226d0b0b92c499e6a1fb6e9bc4 adding utf8 redirection test --- diff --git a/t/lib/Catty/Controller/Root.pm b/t/lib/Catty/Controller/Root.pm index 4d74605..c35798b 100644 --- a/t/lib/Catty/Controller/Root.pm +++ b/t/lib/Catty/Controller/Root.pm @@ -2,7 +2,6 @@ package Catty::Controller::Root; use strict; use warnings; - use base qw/ Catalyst::Controller /; use Cwd; @@ -144,5 +143,12 @@ sub bad_content_encoding :Global { $c->res->body('foo'); } +sub redirect_to_utf8_upgraded_string { + my($self, $c) = @_; + my $where = $c->uri_for('hello')->stringify; + utf8::upgrade($where); + $c->res->redirect($where); +} + 1; diff --git a/t/redirect.t b/t/redirect.t index 8b08bc1..cff9b16 100644 --- a/t/redirect.t +++ b/t/redirect.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 'lib'; -use Test::More tests => 28; +use Test::More tests => 29; use lib 't/lib'; use Test::WWW::Mechanize::Catalyst 'Catty'; @@ -33,3 +33,7 @@ like( $prev->header('Location'), '/hi$/', "to the right place" ); $m->get("$root/redirect_with_500"); is ($m->status, 500, "Redirect not followed on 500"); + +$m->get_ok( "$root/redirect_to_utf8_upgraded_string", + "redirect using an upgraded utf8 string" ); +