X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcontroller_Translate.t;h=47604eb80753cea17c6503bf1d68456286301b88;hb=e639dea98fb69c9382b0823026d8a62111d3053b;hp=1733716753e8794071209db68f973852de463083;hpb=07c4c36ac30e7e200b163d16d49e6102a1284f59;p=catagits%2Fcatbook-code.git diff --git a/t/controller_Translate.t b/t/controller_Translate.t index 1733716..47604eb 100644 --- a/t/controller_Translate.t +++ b/t/controller_Translate.t @@ -20,3 +20,34 @@ ok( $response->is_success, 'Response Successful 2xx' ); is( $response->content_type, 'text/html', 'Response Content-Type' ); like( $response->content, qr/CHEEZ/, "contains translated string"); +ok( + $response = request(GET 'http://localhost/translate/1'), + 'Request for default translation type' +); + +ok( $response->is_success, 'Response Successful 2xx' ); + +like( $response->content, qr/CHEEZ/, "contains translated string"); + +ok( + $response = request(GET 'http://localhost/translate/100'), + 'Request for default translation type on non-existant object' +); + +cmp_ok( $response->code, '==', 404, '404 error returned'); + +ok( + $response = request(GET 'http://localhost/translate/1/to/LOLCAT'), + 'Request for specific translation type' +); + +ok( $response->is_success, 'Response Successful 2xx' ); + +like( $response->content, qr/CHEEZ/, "contains translated string"); + +ok( + $response = request(GET 'http://localhost/translate/1/to/NONEXISTANT'), + 'Request for non-existant translation type' +); + +cmp_ok( $response->code, '==', 404, '404 error returned');