3 use Test::More qw/no_plan/;
5 BEGIN { use_ok 'Catalyst::Test', 'LolCatalyst::Lite' }
7 use HTTP::Request::Common;
9 my ($request, $response);
12 'http://localhost/translate',
13 'Content-Type' => 'form-data',
15 'lol' => 'Can i have a cheese burger?',
18 ok( $response = request($request), 'Request');
19 ok( $response->is_success, 'Response Successful 2xx' );
20 is( $response->content_type, 'text/html', 'Response Content-Type' );
21 like( $response->content, qr/CHEEZ/, "contains translated string");
24 $response = request(GET 'http://localhost/translate/1'),
25 'Request for default translation type'
28 ok( $response->is_success, 'Response Successful 2xx' );
30 like( $response->content, qr/CHEEZ/, "contains translated string");
33 $response = request(GET 'http://localhost/translate/100'),
34 'Request for default translation type on non-existant object'
37 cmp_ok( $response->code, '==', 404, '404 error returned');
40 $response = request(GET 'http://localhost/translate/1/to/LOLCAT'),
41 'Request for specific translation type'
44 ok( $response->is_success, 'Response Successful 2xx' );
46 like( $response->content, qr/CHEEZ/, "contains translated string");
49 $response = request(GET 'http://localhost/translate/1/to/NONEXISTANT'),
50 'Request for non-existant translation type'
53 cmp_ok( $response->code, '==', 404, '404 error returned');