From: Alexander Hartmaier Date: Wed, 18 Aug 2010 11:39:53 +0000 (+0200) Subject: Test use_json_boolean true X-Git-Tag: 2.002003~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=commitdiff_plain;h=0cd7ab9e098294b05a42c52d17cd82e961a72d27 Test use_json_boolean true --- diff --git a/Changes b/Changes index 5270c1f..d7afe1e 100644 --- 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 diff --git a/t/lib/RestTest/Controller/API/REST/Track.pm b/t/lib/RestTest/Controller/API/REST/Track.pm index 33362e0..b62110e 100644 --- a/t/lib/RestTest/Controller/API/REST/Track.pm +++ b/t/lib/RestTest/Controller/API/REST/Track.pm @@ -12,6 +12,7 @@ __PACKAGE__->config update_allows => ['title', 'position', { cd => ['*'] }], page => 1, count => 10, + use_json_boolean => 1, ); 1; diff --git a/t/rest/update.t b/t/rest/update.t index 2f8be2c..3aa7e49 100644 --- a/t/rest/update.t +++ b/t/rest/update.t @@ -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' ); } diff --git a/t/rpc/update.t b/t/rpc/update.t index cbe7eab..37bdbe9 100644 --- a/t/rpc/update.t +++ b/t/rpc/update.t @@ -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' ); }