Added some stress testing
[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
d8c66af5 9use Test::More tests => 160;
749472d6 10use Catalyst::Test 'TestApp';
11
12my $content = q/foo
13bar
14baz
15/;
16
d8c66af5 17for ( 1 .. 10 ) {
18
19 # Local
20 {
21 ok(
22 my $response =
23 request('http://localhost/action/multipath/multipath'),
24 'Request'
25 );
26 ok( $response->is_success, 'Response Successful 2xx' );
27 is( $response->content_type, 'text/plain', 'Response Content-Type' );
28 is( $response->content, $content, 'Content is a stream' );
29 }
30
31 # Global
32 {
33 ok( my $response = request('http://localhost/multipath'), 'Request' );
34 ok( $response->is_success, 'Response Successful 2xx' );
35 is( $response->content_type, 'text/plain', 'Response Content-Type' );
36 is( $response->content, $content, 'Content is a stream' );
37 }
38
39 # Path('/multipath1')
40 {
41 ok( my $response = request('http://localhost/multipath1'), 'Request' );
42 ok( $response->is_success, 'Response Successful 2xx' );
43 is( $response->content_type, 'text/plain', 'Response Content-Type' );
44 is( $response->content, $content, 'Content is a stream' );
45 }
46
47 # Path('multipath2')
48 {
49 ok(
50 my $response =
51 request('http://localhost/action/multipath/multipath2'),
52 'Request'
53 );
54 ok( $response->is_success, 'Response Successful 2xx' );
55 is( $response->content_type, 'text/plain', 'Response Content-Type' );
56 is( $response->content, $content, 'Content is a stream' );
57 }
749472d6 58}