X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_action_chained.t;h=099c8337334f4fbc9b5ae358278a074f7b7c7079;hp=3784fe66e5fed57a00e95005960560624084dd23;hb=36c67dc10cd5a928718d4e9122e03297a959a47e;hpb=3c9a702f521c1635602320cf62f056d362a45c2d diff --git a/t/aggregate/live_component_controller_action_chained.t b/t/aggregate/live_component_controller_action_chained.t index 3784fe6..099c833 100644 --- a/t/aggregate/live_component_controller_action_chained.t +++ b/t/aggregate/live_component_controller_action_chained.t @@ -10,7 +10,7 @@ our $iters; BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } -use Test::More tests => 148*$iters; +use Test::More; use Catalyst::Test 'TestApp'; if ( $ENV{CAT_BENCHMARK} ) { @@ -1018,5 +1018,27 @@ sub run_tests { 'request with URI-encoded arg' ); like( $content, qr{foo/bar;\z}, 'args decoded' ); } + + # Test round tripping, specifically the / character %2F in uri_for: + # not being able to feed it back action + captureargs and args into uri for and result in the original + # request uri is a major piece of suck ;) + # FIXME - what about people who have code to hack around this and manually uri encode args and captures + # themselves, erk! + foreach my $thing ( + ['foo', 'bar'], + ['foo%2Fbar', 'baz'], + ['foo', 'bar%2Fbaz'], + ['foo%2Fbar', 'baz%2Fquux'], + ['foo%2Fbar', 'baz%2Fquux', { foo => 'bar', 'baz' => 'quux%2Ffrood'}], + ['foo%2Fbar', 'baz%2Fquux', { foo => 'bar', 'baz%2Ffnoo' => 'quux%2Ffrood'}], + ) { + my $uri = 'http://localhost/chained/roundtrip_urifor/' . $thing->[0] . '/' . $thing->[1]; + $uri .= '?' . join('&', map { $_ .'='. $thing->[2]->{$_}} sort keys %{$thing->[2]}) if $thing->[2]; + ok( my $content = + get($uri), + 'request ' . $uri . ' ok'); + is( $content, $uri, 'uri can round trip through uri_for' ); + } } +done_testing;