X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_action_chained.t;h=5dd2293de06c9c8962d3fe15b1d950ad30e251fd;hb=3aea242a45514abd7b804d907d57071ebaf990c1;hp=efea301b4bc566d7454d97e6de1d41fe1c0e410e;hpb=29076427c02971d7b3e65326131ff77ca5a43de7;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_component_controller_action_chained.t b/t/aggregate/live_component_controller_action_chained.t index efea301..5dd2293 100644 --- a/t/aggregate/live_component_controller_action_chained.t +++ b/t/aggregate/live_component_controller_action_chained.t @@ -1108,10 +1108,29 @@ sub run_tests { ok( my $content = get('http://localhost/' . $path), 'request ' . $path . ' ok'); + my $exp = URI->new('http://localhost:3000' . $path); + my $got = URI->new($content); # Just check that the path matches, as who the hell knows or cares # where the app is based (live tests etc) - ok( index($content, $path) > 1, 'uri can round trip through uri_for' ) + is $got->path, $exp->path, "uri $path can round trip through uri_for (path)" or diag("Expected $path, got $content"); + my %got_q = map { split /=/ } split /\&/, ($got->query||''); + my %exp_q = map { split /=/ } split /\&/, ($exp->query||''); + is_deeply \%got_q, \%exp_q, "uri $path can round trip through uri_for (query)" + or diag("Expected $path, got $content"); + } + + # + # match_captures + # + { + + ok( my $response = request('http://localhost/chained/match_captures/foo/bar'), 'match_captures: falling through' ); + is($response->header('X-TestAppActionTestMatchCaptures'), 'fallthrough', 'match_captures: fell through'); + + ok($response = request('http://localhost/chained/match_captures/force/bar'), 'match_captures: *not* falling through' ); + is($response->header('X-TestAppActionTestMatchCaptures'), 'forcing', 'match_captures: forced'); + is($response->header('X-TestAppActionTestMatchCapturesHasRan'), 'yes', 'match_captures: actually ran'); } }