Commit | Line | Data |
905679b8 |
1 | use warnings; |
2 | use strict; |
3 | use Test::More; |
4 | |
5 | # Test case for reported issue when an action consumes JSON but a |
6 | # POST sends nothing we get a hard error |
7 | |
8 | { |
9 | package MyApp::Controller::Root; |
10 | $INC{'MyApp/Controller/Root.pm'} = __FILE__; |
11 | |
12 | use base 'Catalyst::Controller'; |
13 | |
14 | sub root :Chained(/) CaptureArgs(0) { } |
15 | |
16 | sub get :GET Chained(root) PathPart('') Args(0) { } |
17 | sub post :POST Chained(root) PathPart('') Args(0) { } |
18 | sub put :PUT Chained(root) PathPart('') Args(0) { } |
19 | |
20 | package MyApp; |
21 | use Catalyst; |
22 | MyApp->setup; |
23 | } |
24 | |
25 | use HTTP::Request::Common; |
26 | use Catalyst::Test 'MyApp'; |
27 | |
28 | { |
29 | ok my $res = request POST 'root/'; |
30 | } |
31 | |
32 | done_testing(); |