aboutsummaryrefslogtreecommitdiffstats
path: root/t/open311/endpoint
diff options
context:
space:
mode:
Diffstat (limited to 't/open311/endpoint')
-rw-r--r--t/open311/endpoint/mysociety.t5
-rw-r--r--t/open311/endpoint/spark.t2
-rw-r--r--t/open311/endpoint/warwick.t5
3 files changed, 4 insertions, 8 deletions
diff --git a/t/open311/endpoint/mysociety.t b/t/open311/endpoint/mysociety.t
index c63e03e43..d0ad60602 100644
--- a/t/open311/endpoint/mysociety.t
+++ b/t/open311/endpoint/mysociety.t
@@ -6,12 +6,11 @@ use Test::MockTime ':all';
use Open311::Endpoint;
use Data::Dumper;
-use JSON;
+use JSON::MaybeXS;
use t::open311::endpoint::Endpoint2;
my $endpoint = t::open311::endpoint::Endpoint2->new;
-my $json = JSON->new;
subtest "POST OK" => sub {
diag "Serves as sanity test of subclassing, as well as preparing our data";
@@ -31,7 +30,7 @@ subtest "POST OK" => sub {
ok $res->is_success, 'valid request'
or diag $res->content;
- is_deeply $json->decode($res->content),
+ is_deeply decode_json($res->content),
[ {
"service_notice" => "This is a test service",
"service_request_id" => 0
diff --git a/t/open311/endpoint/spark.t b/t/open311/endpoint/spark.t
index 589f39baf..015876c94 100644
--- a/t/open311/endpoint/spark.t
+++ b/t/open311/endpoint/spark.t
@@ -4,10 +4,8 @@ use Test::More;
use Open311::Endpoint;
use Data::Dumper;
-use JSON;
my $endpoint = Open311::Endpoint->new;
-my $json = JSON->new;
subtest "Spark test" => sub {
my $spark = $endpoint->spark;
diff --git a/t/open311/endpoint/warwick.t b/t/open311/endpoint/warwick.t
index 5c47cd529..e5f124c8d 100644
--- a/t/open311/endpoint/warwick.t
+++ b/t/open311/endpoint/warwick.t
@@ -5,7 +5,7 @@ use Test::LongString;
use Test::MockTime ':all';
use Data::Dumper;
-use JSON;
+use JSON::MaybeXS;
use FixMyStreet::DB;
@@ -19,7 +19,6 @@ use Open311::PopulateServiceList;
use Open311::GetServiceRequestUpdates;
my $endpoint = t::open311::endpoint::Endpoint_Warwick->new;
-my $json = JSON->new;
subtest "GET Service List" => sub {
my $res = $endpoint->run_test_request( GET => '/services.xml' );
@@ -59,7 +58,7 @@ subtest "POST OK" => sub {
ok $res->is_success, 'valid request'
or diag $res->content;
- is_deeply $json->decode($res->content),
+ is_deeply decode_json($res->content),
[ {
"service_notice" => "Warwickshire Open311 Endpoint",
"service_request_id" => 1001