use Dist::Zilla::PluginBundle::Git
[catagits/Catalyst-Controller-DBIC-API.git] / t / rpc / item.t
index c84f2e4..417bffb 100644 (file)
@@ -1,5 +1,3 @@
-use 5.6.0;
-
 use strict;
 use warnings;
 
@@ -13,9 +11,9 @@ use URI;
 use Test::More;
 use Test::WWW::Mechanize::Catalyst 'RestTest';
 use HTTP::Request::Common;
-use JSON;
+use JSON::MaybeXS;
 
-my $json = JSON->new->utf8;
+my $json = JSON::MaybeXS->new(utf8 => 1);
 
 my $mech = Test::WWW::Mechanize::Catalyst->new;
 ok( my $schema = DBICTest->init_schema(), 'got schema' );
@@ -24,8 +22,7 @@ my $artist_view_url = "$base/api/rpc/artist/id/";
 
 {
     my $id = 1;
-    my $req =
-        GET( $artist_view_url . $id, undef, 'Accept' => 'application/json' );
+    my $req = GET( $artist_view_url . $id, 'Accept' => 'application/json' );
     $mech->request($req);
     cmp_ok( $mech->status, '==', 200, 'open attempt okay' );
     my %expected_response =
@@ -40,8 +37,7 @@ my $artist_view_url = "$base/api/rpc/artist/id/";
 
 {
     my $id = 5;
-    my $req =
-        GET( $artist_view_url . $id, undef, 'Accept' => 'application/json' );
+    my $req = GET( $artist_view_url . $id, 'Accept' => 'application/json' );
     $mech->request($req);
     cmp_ok( $mech->status, '==', 400, 'open attempt not ok' );
     my $response = $json->decode( $mech->content );