X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_action_regexp.t;h=36a679e339f20fa8b41aee7dd34d497a354bb42e;hb=81f25ce60d12146ada6baa3ed8db87a0e8a54408;hp=ab5d4baec11b5c2a7d0ffe46a6fa6760f2baa6f4;hpb=42da66a91b0a87ebb81d8552bcd0b05d3557c83e;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_component_controller_action_regexp.t b/t/aggregate/live_component_controller_action_regexp.t index ab5d4ba..36a679e 100644 --- a/t/aggregate/live_component_controller_action_regexp.t +++ b/t/aggregate/live_component_controller_action_regexp.t @@ -10,7 +10,7 @@ our $iters; BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } -use Test::More tests => 33*$iters; +use Test::More tests => 38*$iters; use Catalyst::Test 'TestApp'; use Catalyst::Request; @@ -118,4 +118,26 @@ sub run_tests { 'Test Class' ); } + + { + my $url = 'http://localhost/action/regexp/redirect/life/universe/42/everything'; + ok( my $response = request($url), + 'Request' ); + ok( $response->is_redirect, 'Response is redirect' ); + is( $response->header('X-Catalyst-Action'), + '^action/regexp/redirect/(\w+)/universe/(\d+)/everything$', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Regexp', + 'Test Class' + ); + my $location = $response->header('location'); + $location =~ s/localhost(:\d+)?/localhost/; + is( + $location, + $url, + 'Redirect URI is the same as the request URI' + ); + } } +