aboutsummaryrefslogtreecommitdiffstats
path: root/t/open311/endpoint.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-02-05 23:36:19 +0000
committerMatthew Somerville <matthew@mysociety.org>2016-02-09 14:21:51 +0000
commitb029f3d084b0dbd4136f7fd48d2e222edc683b6f (patch)
treebb565e639e3a792e9412a22e8e02caf424d491b7 /t/open311/endpoint.t
parentcf80773fa925f36a7c43b5f7eb1bcf7f56593796 (diff)
Switch final few JSON uses to JSON::MaybeXS.
Diffstat (limited to 't/open311/endpoint.t')
-rw-r--r--t/open311/endpoint.t9
1 files changed, 4 insertions, 5 deletions
diff --git a/t/open311/endpoint.t b/t/open311/endpoint.t
index 7e684c491..38314f079 100644
--- a/t/open311/endpoint.t
+++ b/t/open311/endpoint.t
@@ -6,12 +6,11 @@ use Test::MockTime ':all';
use Open311::Endpoint;
use Data::Dumper;
-use JSON;
+use JSON::MaybeXS;
use t::open311::endpoint::Endpoint1;
my $endpoint = t::open311::endpoint::Endpoint1->new;
-my $json = JSON->new;
subtest "GET Service List" => sub {
my $res = $endpoint->run_test_request( GET => '/services.xml' );
@@ -43,7 +42,7 @@ CONTENT
$res = $endpoint->run_test_request( GET => '/services.json' );
ok $res->is_success, 'json success';
- is_deeply $json->decode($res->content),
+ is_deeply decode_json($res->content),
[ {
"keywords" => "deep,hole,wow",
"group" => "highways",
@@ -111,7 +110,7 @@ CONTENT
$res = $endpoint->run_test_request( GET => '/services/POT.json' );
ok $res->is_success, 'json success';
- is_deeply $json->decode($res->content),
+ is_deeply decode_json($res->content),
{
"service_code" => "POT",
"attributes" => [
@@ -209,7 +208,7 @@ subtest "POST Service Request valid test" => 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