add 'to' action to controller, add test (currently failing, show error)
[catagits/catbook-code.git] / t / controller_Translate.t
CommitLineData
07c4c36a 1use strict;
2use warnings;
3use Test::More qw/no_plan/;
4
5BEGIN { use_ok 'Catalyst::Test', 'LolCatalyst::Lite' }
6
7use HTTP::Request::Common;
8
9my ($request, $response);
10
11$request = POST(
12 'http://localhost/translate',
13 'Content-Type' => 'form-data',
14 'Content' => [
15 'lol' => 'Can i have a cheese burger?',
16 ]);
17
18ok( $response = request($request), 'Request');
19ok( $response->is_success, 'Response Successful 2xx' );
20is( $response->content_type, 'text/html', 'Response Content-Type' );
21like( $response->content, qr/CHEEZ/, "contains translated string");
22
9671ec67 23ok(
24 $response = request(GET 'http://localhost/translate/1/to/LOLCAT'),
25 'Request for specific translation type'
26);
27
28ok( $response->is_success, 'Response Successful 2xx' );
29
30like( $response->content, qr/CHEEZ/, "contains translated string");