Add failing test for utf8 redirection when URI.pm < 1.59 with Catalyst-5.9
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / redirect.t
index cff9b16..34ee311 100644 (file)
@@ -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 @@ 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" );
-
+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);