X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Funit_core_uri_for_action.t;fp=t%2Funit_core_uri_for_action.t;h=d4f4148ebcfa56f05d2bf7a5170b361d5ea38f2a;hp=a0297f40e59b7a0418f3484f662100c54ec17ca4;hb=ae29b412955743885e80350085167b54b69672da;hpb=e16a6c4e6c4d49e73b5286b3186616af14f3f554 diff --git a/t/unit_core_uri_for_action.t b/t/aggregate/unit_core_uri_for_action.t similarity index 92% rename from t/unit_core_uri_for_action.t rename to t/aggregate/unit_core_uri_for_action.t index a0297f4..d4f4148 100644 --- a/t/unit_core_uri_for_action.t +++ b/t/aggregate/unit_core_uri_for_action.t @@ -4,7 +4,7 @@ use strict; use warnings; use FindBin; -use lib "$FindBin::Bin/lib"; +use lib "$FindBin::Bin/../lib"; use Test::More; @@ -120,17 +120,17 @@ is($context->uri_for($chained_action, [ 1 ], 2, { q => 1 }), # More Chained with Context Tests # { - sub __action { $dispatcher->get_action_by_path( @_ ) } + sub __action { shift->get_action_by_path( @_ ) } - is( $context->uri_for( __action( '/action/chained/endpoint2' ), [1,2], (3,4), { x => 5 } ), + is( $context->uri_for( __action( $dispatcher, '/action/chained/endpoint2' ), [1,2], (3,4), { x => 5 } ), 'http://127.0.0.1/foo/chained/foo2/1/2/end2/3/4?x=5', 'uri_for correct for chained with multiple captures and args' ); - is( $context->uri_for( __action( '/action/chained/three_end' ), [1,2,3], (4,5,6) ), + is( $context->uri_for( __action( $dispatcher, '/action/chained/three_end' ), [1,2,3], (4,5,6) ), 'http://127.0.0.1/foo/chained/one/1/two/2/3/three/4/5/6', 'uri_for correct for chained with multiple capturing actions' ); - my $action_needs_two = __action( '/action/chained/endpoint2' ); + my $action_needs_two = __action( $dispatcher, '/action/chained/endpoint2' ); ok( ! defined( $context->uri_for($action_needs_two, [1], (2,3)) ), 'uri_for returns undef for not enough captures' ); @@ -162,7 +162,7 @@ is($context->uri_for($chained_action, [ 1 ], 2, { q => 1 }), 'http://127.0.0.1/foo/chained/foo2/1/2/end2/3/', 'uri_for returns uri with empty arg on undef last argument' ); - my $complex_chained = __action( '/action/chained/empty_chain_f' ); + my $complex_chained = __action( $dispatcher, '/action/chained/empty_chain_f' ); is( $context->uri_for( $complex_chained, [23], (13), {q => 3} ), 'http://127.0.0.1/foo/chained/empty/23/13?q=3', 'uri_for returns correct uri for chain with many empty path parts' );