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%2Faggregate%2Funit_core_uri_for_action.t;h=73413659a4c18f0561530211af9ad3bf1a7c0996;hp=4036f88f1e1d9ab9600e1474b9c187aa0c0819ac;hb=950282bc140f3044f59fc3a70f6f63857f963d7b;hpb=3b5f9ebb20d100adc0304537f64825eea29f3a06 diff --git a/t/aggregate/unit_core_uri_for_action.t b/t/aggregate/unit_core_uri_for_action.t index 4036f88..7341365 100644 --- a/t/aggregate/unit_core_uri_for_action.t +++ b/t/aggregate/unit_core_uri_for_action.t @@ -77,6 +77,36 @@ my $context = TestApp->new( { namespace => 'yada', } ); + + + +# this works, using $ctx +is($context->uri_for( 'TestApp', $context->controller('Action::Chained')->action_for('endpoint')), + "http://127.0.0.1/foo/yada/chained/foo/end", + "uri_for a controller and action"); + +# this fails, uri_for returns undef, why isn't this one working?? +is( $context->uri_for_action( '/action/chained/endpoint' ), + 'http://127.0.0.1/chained/foo/end', + "uri_for a controller and action as string"); + +# this fails, uri_for returns undef +is(Catalyst::uri_for_action( 'TestApp', $context->controller('Action::Chained')->action_for('endpoint')), + "/chained/foo/end", + "uri_for a controller and action, called with only class name"); + +# this fails, uri_for returns undef +is(Catalyst::uri_for_action( 'TestApp', '/action/chained/endpoint' ), + "/chained/foo/end", + "uri_for a controller and action as string, called with only class name"); + +# this fails, uri_for returns undef +is(Catalyst::uri_for_action( 'TestApp', $chained_action), + "/chained/foo/end", + "uri_for action via dispatcher, called with only class name"); + + + is($context->uri_for($context->controller('Action')), "http://127.0.0.1/foo/yada/action/", "uri_for a controller");