Tests which I believe show that JSON encoding is handled correctly. I.E. You pass...
[catagits/Catalyst-Action-REST.git] / t / lib / Test / Serialize / Controller / REST.pm
index 0499f1d..dad5483 100644 (file)
@@ -31,11 +31,13 @@ __PACKAGE__->config(
 
 sub monkey_put : Local : ActionClass('Deserialize') {
     my ( $self, $c ) = @_;
-       if ( ref($c->req->data) eq "HASH" ) {
-               $c->res->output( $c->req->data->{'sushi'} );
-       } else {
-               $c->res->output(1);
-       }
+    if ( ref($c->req->data) eq "HASH" ) {
+        my $out = $c->req->data->{'sushi'} . $c->req->data->{'chicken'}||'';
+        utf8::encode($out);
+        $c->res->output( $out );
+    } else {
+        $c->res->output(1);
+    }
 }
 
 sub monkey_get : Local : ActionClass('Serialize') {
@@ -44,4 +46,3 @@ sub monkey_get : Local : ActionClass('Serialize') {
 }
 
 1;
-