Test use_json_boolean true
Alexander Hartmaier [Wed, 18 Aug 2010 11:39:53 +0000 (13:39 +0200)]
Changes
t/lib/RestTest/Controller/API/REST/Track.pm
t/rest/update.t
t/rpc/update.t

diff --git a/Changes b/Changes
index 5270c1f..d7afe1e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -7,6 +7,7 @@ Revision history for Catalyst-Controller-DBIC-API: {{ $dist->version }}
 - Added REST and RPC update_bulk tests
 - Removed useless RPC index action
 - Fixed static configured page attribute not being used (RT#56226)
+- Test use_json_boolean true
 
 2.002002  2010-08-03 14:40:50 Europe/Vienna
 
index 33362e0..b62110e 100644 (file)
@@ -12,6 +12,7 @@ __PACKAGE__->config
       update_allows => ['title', 'position', { cd => ['*'] }],
       page => 1,
       count => 10,
+      use_json_boolean => 1,
       );
 
 1;
index 2f8be2c..3aa7e49 100644 (file)
@@ -110,7 +110,7 @@ my $tracks_update_url = $track_url;
   $mech->request($req);
   cmp_ok( $mech->status, '==', 400, 'Attempt to update three nonexisting tracks fails' );
   my $response = JSON::Any->Load( $mech->content);
-  is( $response->{success}, JSON::Any::false, 'success property returns false' );
+  is( $response->{success}, JSON::Any::false, 'success property returns unquoted false' );
   like( $response->{messages}->[0], qr/No object found for id/, 'correct message returned' );
 }
 
index cbe7eab..37bdbe9 100644 (file)
@@ -156,7 +156,7 @@ my $tracks_update_url = "$base/api/rpc/track/update";
   $mech->request($req);
   cmp_ok( $mech->status, '==', 400, 'Attempt to update three nonexisting tracks fails' );
   my $response = JSON::Any->Load( $mech->content);
-  is( $response->{success}, JSON::Any::false, 'success property returns false' );
+  is( $response->{success}, 'false', 'success property returns quoted false' );
   like( $response->{messages}->[0], qr/No object found for id/, 'correct message returned' );
 }