use Test::More;
-plan tests => 39;
-
use_ok('TestApp');
my $dispatcher = TestApp->dispatcher;
'/class_forward_test_method'
);
-warn $dispatcher->uri_for_action($private_action);
-
ok(!defined($dispatcher->uri_for_action($private_action)),
"Private action returns undef for URI");
"/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
#
# Tests with Context
#
my $request = Catalyst::Request->new( {
+ _log => Catalyst::Log->new,
base => URI->new('http://127.0.0.1/foo')
} );
}
+done_testing;
+