X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_uri_for.t;h=bd0690b554ee40a18b835e355fe62217ece89b87;hb=7a7d7af5e9a6ba3cd59dab7995114c10216143f3;hp=c6726f6a7f84e8d881412547e6d1cfbe2d60feb7;hpb=d3e7a648cc29a8b45ddcd4ef731e3f9b0b4f919c;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_uri_for.t b/t/unit_core_uri_for.t index c6726f6..bd0690b 100644 --- a/t/unit_core_uri_for.t +++ b/t/unit_core_uri_for.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 9; use Test::MockObject; use URI; @@ -36,6 +36,19 @@ is( is( Catalyst::uri_for( $context, '../quux' )->as_string, 'http://127.0.0.1/foo/quux', 'URI for relative dot path' ); +is( + Catalyst::uri_for( $context, 'quux', { param1 => 'value1' } )->as_string, + 'http://127.0.0.1/foo/yada/quux?param1=value1', + 'URI for undef action with query params' +); + +# test with utf-8 +is( + Catalyst::uri_for( $context, 'quux', { param1 => "\x{2620}" } )->as_string, + 'http://127.0.0.1/foo/yada/quux?param1=%E2%98%A0', + 'URI for undef action with query params in unicode' +); + $request->mock( 'base', sub { URI->new('http://localhost:3000/') } ); $request->mock( 'match', sub { 'orderentry/contract' } ); is( @@ -54,3 +67,4 @@ is( is( Catalyst::uri_for( $context, '/bar/baz' )->as_string, 'http://127.0.0.1/bar/baz', 'URI with no base or match' ); } +