[Catalyst-commits] r14284 - in Test-WWW-Mechanize-Catalyst/trunk: .
t t/lib/Catty/Controller
wreis at dev.catalyst.perl.org
wreis at dev.catalyst.perl.org
Mon Apr 9 14:08:00 GMT 2012
Author: wreis
Date: 2012-04-09 14:08:00 +0000 (Mon, 09 Apr 2012)
New Revision: 14284
Modified:
Test-WWW-Mechanize-Catalyst/trunk/Makefile.PL
Test-WWW-Mechanize-Catalyst/trunk/t/lib/Catty/Controller/Root.pm
Test-WWW-Mechanize-Catalyst/trunk/t/redirect.t
Log:
Add failing test for utf8 redirection when URI.pm < 1.59 with Catalyst-5.9
Modified: Test-WWW-Mechanize-Catalyst/trunk/Makefile.PL
===================================================================
--- Test-WWW-Mechanize-Catalyst/trunk/Makefile.PL 2012-04-05 14:37:07 UTC (rev 14283)
+++ Test-WWW-Mechanize-Catalyst/trunk/Makefile.PL 2012-04-09 14:08:00 UTC (rev 14284)
@@ -19,6 +19,7 @@
test_requires 'Catalyst::Plugin::Session::Store::Dummy' => '0';
test_requires 'Test::Exception' => '0';
test_requires 'Test::More' => '0';
+test_requires 'Test::utf8' => '0';
if ($Module::Install::AUTHOR) {
system('pod2text lib/Test/WWW/Mechanize/Catalyst.pm > README');
Modified: Test-WWW-Mechanize-Catalyst/trunk/t/lib/Catty/Controller/Root.pm
===================================================================
--- Test-WWW-Mechanize-Catalyst/trunk/t/lib/Catty/Controller/Root.pm 2012-04-05 14:37:07 UTC (rev 14283)
+++ Test-WWW-Mechanize-Catalyst/trunk/t/lib/Catty/Controller/Root.pm 2012-04-09 14:08:00 UTC (rev 14284)
@@ -7,6 +7,7 @@
use Cwd;
use MIME::Base64;
use Encode ();
+use utf8;
__PACKAGE__->config( namespace => '' );
@@ -143,9 +144,9 @@
$c->res->body('foo');
}
-sub redirect_to_utf8_upgraded_string {
+sub redirect_to_utf8_upgraded_string : Global {
my($self, $c) = @_;
- my $where = $c->uri_for('hello')->stringify;
+ my $where = $c->uri_for('hello', 'müller')->as_string;
utf8::upgrade($where);
$c->res->redirect($where);
}
Modified: Test-WWW-Mechanize-Catalyst/trunk/t/redirect.t
===================================================================
--- Test-WWW-Mechanize-Catalyst/trunk/t/redirect.t 2012-04-05 14:37:07 UTC (rev 14283)
+++ Test-WWW-Mechanize-Catalyst/trunk/t/redirect.t 2012-04-09 14:08:00 UTC (rev 14284)
@@ -2,9 +2,12 @@
use strict;
use warnings;
use lib 'lib';
-use Test::More tests => 29;
+use Test::More tests => 30;
use lib 't/lib';
use Test::WWW::Mechanize::Catalyst 'Catty';
+use HTTP::Request::Common;
+use URI;
+use Test::utf8;
my $root = "http://localhost";
@@ -34,6 +37,8 @@
$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" );
-
+my $req = GET "$root/redirect_to_utf8_upgraded_string";
+my $loc = $m->_do_catalyst_request($req)->header('Location');
+my $uri = URI->new_abs( $loc, $req->uri )->as_string;
+is_sane_utf8($uri);
+isnt_flagged_utf8($uri);
More information about the Catalyst-commits
mailing list