Fixed second bug
[catagits/Catalyst-Runtime.git] / t / live / component / controller / action / multipath.t
CommitLineData
749472d6 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin;
7use lib "$FindBin::Bin/../../../lib";
8
9use Test::More tests => 16;
10use Catalyst::Test 'TestApp';
11
12my $content = q/foo
13bar
14baz
15/;
16
17# Local
18{
19 ok( my $response = request('http://localhost/action/multipath/multipath'),
20 'Request' );
21 ok( $response->is_success, 'Response Successful 2xx' );
22 is( $response->content_type, 'text/plain', 'Response Content-Type' );
23 is( $response->content, $content, 'Content is a stream' );
24}
25
26# Global
27{
28 ok( my $response = request('http://localhost/multipath'), 'Request' );
29 ok( $response->is_success, 'Response Successful 2xx' );
30 is( $response->content_type, 'text/plain', 'Response Content-Type' );
31 is( $response->content, $content, 'Content is a stream' );
32}
33
34# Path('/multipath1')
35{
36 ok( my $response = request('http://localhost/multipath1'), 'Request' );
37 ok( $response->is_success, 'Response Successful 2xx' );
38 is( $response->content_type, 'text/plain', 'Response Content-Type' );
39 is( $response->content, $content, 'Content is a stream' );
40}
41
42# Path('multipath2')
43{
44 ok( my $response = request('http://localhost/action/multipath/multipath2'),
45 'Request' );
46 ok( $response->is_success, 'Response Successful 2xx' );
47 is( $response->content_type, 'text/plain', 'Response Content-Type' );
48 is( $response->content, $content, 'Content is a stream' );
49}