Added index tests, 2 are failing
[catagits/Catalyst-Runtime.git] / t / live / component / controller / action / index.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use FindBin;
7 use lib "$FindBin::Bin/../../../lib";
8
9 use Test::More tests => 10;
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     
22     # test controller index
23     {
24         ok( my $response = request('http://localhost/action/index/'), 'controller index' );
25         is( $response->content, 'Action::Index index', 'controller index ok' );
26         
27         ok( $response = request('http://localhost/action/index'), 'controller index no slash' );
28         is( $response->content, 'Action::Index index', 'controller index no slash ok' );        
29     }
30     
31     # test controller default when index is present
32     {
33         ok( my $response = request('http://localhost/action/index/foo'), 'default with index' );
34         is( $response->content, "Error - TestApp::Controller::Action\n", 'default with index ok' );
35     }
36 }