test two endpoints with the same endpoint name (empty string)
[catagits/CatalystX-Routes.git] / t / lib / MyApp1 / Controller / C1.pm
CommitLineData
c4057ce2 1package MyApp1::Controller::C1;
2
3use Moose;
4use CatalystX::Routes;
5
69d9fc4e 6BEGIN { extends 'Catalyst::Controller' }
c4057ce2 7
69d9fc4e 8our %REQ;
9
10sub _get { $REQ{get}++ }
11sub _get_html { $REQ{get_html}++ }
12sub _post { $REQ{post}++ }
13sub _put { $REQ{put}++ }
14sub _del { $REQ{delete}++ }
c4057ce2 15
16get '/foo' => \&_get;
17
18get_html '/foo' => \&_get_html;
19
20post '/foo' => \&_post;
21
22put '/foo' => \&_put;
23
24del '/foo' => \&_del;
25
77d62699 26get 'bar'=> \&_get;
27
28get_html 'bar'=> \&_get_html;
29
30post 'bar'=> \&_post;
31
32put 'bar'=> \&_put;
33
34del 'bar'=> \&_del;
35
73bef299 36chain_point '_set_chain1'
37 => chained '/'
38 => path_part 'chain1'
39 => capture_args 1
40 => sub { $REQ{chain1} = $_[2] };
41
42chain_point '_set_chain2'
43 => chained '_set_chain1'
44 => path_part 'chain2'
45 => capture_args 1
46 => sub { $REQ{chain2} = $_[2] };
47
48get 'baz'
49 => chained '_set_chain2'
50 => args 1
51 => sub { $REQ{baz} = $_[2] };
52
ba806aaf 53chain_point '_set_user'
54 => chained '/'
55 => path_part 'user'
56 => capture_args 1
57 => sub { $REQ{user} = $_[2] };
58
59get ''
60 => chained '_set_user'
61 => args 0
8dbe9ea8 62 => sub { $REQ{user_end} = $REQ{user} };
63
64chain_point '_set_thing'
65 => chained '/'
66 => path_part 'thing'
67 => capture_args 1
68 => sub { $REQ{thing} = $_[2] };
69
70get ''
71 => chained '_set_thing'
72 => args 0
73 => sub { $REQ{thing_end} = $REQ{user} };
ba806aaf 74
69d9fc4e 75sub normal : Chained('/') : Args(0) {
76 $REQ{normal}++;
77}
78
c4057ce2 791;