7 use Catalyst::Test 'MyApp1';
8 use HTTP::Request::Common qw( GET PUT POST DELETE );
14 Accept => 'application/json',
19 $MyApp1::Controller::C1::REQ{get}, 1,
20 'GET request for /foo went to the right sub'
31 $MyApp1::Controller::C1::REQ{get_html}, 1,
32 'GET request for /foo that looks like a browser went to the right sub'
35 request( POST '/foo' );
38 $MyApp1::Controller::C1::REQ{post}, 1,
39 'POST request for /foo went to the right sub'
42 request( PUT '/foo' );
45 $MyApp1::Controller::C1::REQ{put}, 1,
46 'PUT request for /foo went to the right sub'
49 request( DELETE '/foo' );
52 $MyApp1::Controller::C1::REQ{delete}, 1,
53 'DELETE request for /foo went to the right sub'
61 $MyApp1::Controller::C1::REQ{get}, 2,
62 'GET request for c1/bar went to the right sub'
73 $MyApp1::Controller::C1::REQ{get_html}, 2,
74 'GET request for c1/bar that looks like a browser went to the right sub'
77 request( POST 'c1/bar' );
80 $MyApp1::Controller::C1::REQ{post}, 2,
81 'POST request for c1/bar went to the right sub'
84 request( PUT 'c1/bar' );
87 $MyApp1::Controller::C1::REQ{put}, 2,
88 'PUT request for c1/bar went to the right sub'
91 request( DELETE 'c1/bar' );
94 $MyApp1::Controller::C1::REQ{delete}, 2,
95 'DELETE request for c1/bar went to the right sub'
103 $MyApp1::Controller::C1::REQ{normal}, 1,
104 'GET request for /norma went to the right sub'
107 request( POST '/normal' );
110 $MyApp1::Controller::C1::REQ{normal}, 2,
111 'POST request for /norma went to the right sub'