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=ccc59105d637d376d68531051e7eeb1f6e919b03;hp=4431f5a704e66b11185898a654e6f9124641537f;hb=b1cb1951d47533ecf9ccd52aaac1d02f051cf205;hpb=72f6a252862f736bc6b766438722fc7b409d8417 diff --git a/t/aggregate/unit_core_uri_for_action.t b/t/aggregate/unit_core_uri_for_action.t index 4431f5a..ccc5910 100644 --- a/t/aggregate/unit_core_uri_for_action.t +++ b/t/aggregate/unit_core_uri_for_action.t @@ -8,7 +8,7 @@ use lib "$FindBin::Bin/../lib"; use Test::More; -plan tests => 30; +plan tests => 33; use_ok('TestApp'); @@ -54,6 +54,21 @@ is($dispatcher->uri_for_action($regex_action, [ 'foo', 123 ]), "/action/regexp/foo/123", "Regex action interpolates captures correctly"); +my $regex_action_bs = $dispatcher->get_action_by_path( + '/action/regexp/one_backslashes' + ); + +ok(!defined($dispatcher->uri_for_action($regex_action_bs)), + "Regex action without captures returns undef"); + +ok(!defined($dispatcher->uri_for_action($regex_action_bs, [ 1, 2, 3 ])), + "Regex action with too many captures returns undef"); + +is($dispatcher->uri_for_action($regex_action_bs, [ 'foo', 123 ]), + "/action/regexp/foo/123.html", + "Regex action interpolates captures correctly"); + + # # Index Action #