Added chain_point to create a non-REST chain point - added tests
[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
69d9fc4e 53sub normal : Chained('/') : Args(0) {
54 $REQ{normal}++;
55}
56
c4057ce2 571;