Commit | Line | Data |
e0e47c71 |
1 | #!perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use FindBin; |
7 | use lib "$FindBin::Bin/../../../lib"; |
8 | |
a83a5398 |
9 | use Test::More tests => 14; |
e0e47c71 |
10 | use Catalyst::Test 'TestApp'; |
11 | |
12 | for ( 1 .. 1 ) { |
13 | # test root index |
14 | { |
15 | ok( my $response = request('http://localhost/'), 'root index' ); |
16 | is( $response->content, 'root index', 'root index ok' ); |
17 | |
18 | ok( $response = request('http://localhost'), 'root index no slash' ); |
19 | is( $response->content, 'root index', 'root index no slash ok' ); |
20 | } |
21 | |
a83a5398 |
22 | # test first-level controller index |
e0e47c71 |
23 | { |
a83a5398 |
24 | ok( my $response = request('http://localhost/action/'), 'first-level controller index' ); |
25 | is( $response->content, 'Action index', 'first-level controller index ok' ); |
e0e47c71 |
26 | |
a83a5398 |
27 | ok( $response = request('http://localhost/action'), 'first-level controller index no slash' ); |
28 | is( $response->content, 'Action index', 'first-level controller index no slash ok' ); |
29 | } |
30 | |
31 | # test second-level controller index |
32 | { |
33 | ok( my $response = request('http://localhost/action/index/'), 'second-level controller index' ); |
34 | is( $response->content, 'Action::Index index', 'second-level controller index ok' ); |
35 | |
36 | ok( $response = request('http://localhost/action/index'), 'second-level controller index no slash' ); |
37 | is( $response->content, 'Action::Index index', 'second-level controller index no slash ok' ); |
e0e47c71 |
38 | } |
39 | |
40 | # test controller default when index is present |
41 | { |
42 | ok( my $response = request('http://localhost/action/index/foo'), 'default with index' ); |
43 | is( $response->content, "Error - TestApp::Controller::Action\n", 'default with index ok' ); |
44 | } |
45 | } |