add tests for view of object and for 404
Matt S Trout [Sat, 7 Mar 2009 21:05:52 +0000 (16:05 -0500)]
t/controller_Translate.t

index 59c2ca4..21c8ea3 100644 (file)
@@ -21,6 +21,22 @@ 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'
 );