Commit | Line | Data |
c7ded7aa |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
42da66a9 |
5 | use lib "$FindBin::Bin/../lib"; |
c7ded7aa |
6 | |
7 | use Test::More tests => 6; |
8 | use Catalyst::Test 'TestApp'; |
9 | |
10 | # phaylon noticed that refactored was truncating output on large images. |
11 | # This test tests 100K and 1M output content. |
12 | |
13 | my $expected = { |
14 | one => 'x' x (100 * 1024), |
15 | two => 'y' x (1024 * 1024), |
16 | }; |
17 | |
18 | for my $action ( keys %{$expected} ) { |
19 | ok( my $response = request('http://localhost/engine/response/large/' . $action ), |
20 | 'Request' ); |
21 | ok( $response->is_success, 'Response Successful 2xx' ); |
22 | |
23 | is( length( $response->content ), length( $expected->{$action} ), 'Length OK' ); |
24 | } |
25 | |