From: Matt S Trout Date: Wed, 4 Mar 2009 14:44:21 +0000 (-0500) Subject: extract translate controller tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2Fcatbook-code.git;a=commitdiff_plain;h=07c4c36ac30e7e200b163d16d49e6102a1284f59;hp=6955a293d26db85371da41dc2f60db1348ff9d4d extract translate controller tests --- diff --git a/t/01app.t b/t/01app.t index 296618f..94eccd2 100644 --- a/t/01app.t +++ b/t/01app.t @@ -1,7 +1,6 @@ use strict; use warnings; -# use Test::More qw/no_plan/; -use Test::More tests => 13; +use Test::More qw/no_plan/; BEGIN { use_ok 'Catalyst::Test', 'LolCatalyst::Lite' } @@ -17,20 +16,6 @@ use Test::More tests => 13; is( $response->content_type, 'text/html', 'Response Content-Type' ); like( $response->content, qr/Translate/, "contains translated string"); - # test request to translate - - $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"); - # test request to translate_service $request = POST( diff --git a/t/controller_Translate.t b/t/controller_Translate.t new file mode 100644 index 0000000..1733716 --- /dev/null +++ b/t/controller_Translate.t @@ -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"); +