extract translate controller tests
[catagits/catbook-code.git] / t / controller_Translate.t
diff --git a/t/controller_Translate.t b/t/controller_Translate.t
new file mode 100644 (file)
index 0000000..1733716
--- /dev/null
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+use Test::More qw/no_plan/;
+
+BEGIN { use_ok 'Catalyst::Test', 'LolCatalyst::Lite' }
+
+use HTTP::Request::Common;
+
+my ($request, $response);
+
+$request = POST(
+        'http://localhost/translate',
+        'Content-Type' => 'form-data',
+        'Content'      => [
+            'lol' => 'Can i have a cheese burger?',
+        ]);
+
+ok( $response = request($request), 'Request');
+ok( $response->is_success, 'Response Successful 2xx' );
+is( $response->content_type, 'text/html', 'Response Content-Type' );
+like( $response->content, qr/CHEEZ/, "contains translated string");
+