Commit | Line | Data |
9693c763 |
1 | use FindBin; |
2 | use lib "$FindBin::Bin/lib"; |
3 | use Catalyst::Test 'TestApp', {default_host => 'default.com'}; |
4 | use Catalyst::Request; |
5 | |
6 | use Test::More; |
7 | |
8 | { |
9 | my @routes = ( |
10 | ["test_remove_body_with_304", |
11 | 304 ], |
12 | ["test_remove_body_with_204", |
13 | 204 ], |
14 | ["test_remove_body_with_100", |
15 | 100 ], |
16 | ["test_nobody_with_100", |
17 | 100 ] |
18 | ); |
19 | |
20 | foreach my $element (@routes ) { |
21 | my $route = $element->[0]; |
22 | my $expected_code = $element->[1]; |
23 | my $request = |
24 | HTTP::Request->new( GET => "http://localhost:3000/$route" ); |
25 | ok( my $response = request($request), "Request for $route"); |
26 | is( $response->code, |
27 | $expected_code, |
28 | "Status code for $route is $expected_code"); |
29 | is( $response->content, |
30 | '', |
31 | "Body for $route is not present"); |
32 | } |
33 | } |
34 | |
35 | done_testing; |