fix root default thingie jayk gave me, sanitize Paths at registration time better
[catagits/Catalyst-Runtime.git] / t / aggregate / live_component_controller_action_index_or_default.t
CommitLineData
2ee0056e 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin;
7use lib "$FindBin::Bin/../lib";
8
9our $iters;
10
11BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
12
5299fff8 13use Test::More tests => 6*$iters;
2ee0056e 14
05b47f2e 15use Catalyst::Test 'TestAppIndexDefault';
2ee0056e 16
17if ( $ENV{CAT_BENCHMARK} ) {
18 require Benchmark;
19 Benchmark::timethis( $iters, \&run_tests );
20}
21else {
22 for ( 1 .. $iters ) {
23 run_tests();
24 }
25}
26
27sub run_tests {
28 is(get('/indexchained'), 'index_chained', ':Chained overrides index');
05b47f2e 29 is(get('/indexprivate'), 'index_private', 'index : Private still works');
5299fff8 30
31# test :Path overriding default
91955398 32 is(get('/one_arg'), 'path_one_arg', ':Path overrides default');
5299fff8 33 is(get('/one_arg/foo/bar'), 'default', 'default still works');
34
35# now the same thing with a namespace, and a trailing / on the :Path
36 is(get('/default/one_arg'), 'default_path_one_arg',
37 ':Path overrides default');
38 is(get('/default/one_arg/foo/bar'), 'default_default',
39 'default still works');
2ee0056e 40}