diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-06-18 16:57:01 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-07-15 18:38:30 +0100 |
commit | a001d6f3ce44b412bb2aabdca2fa13e4a66031ba (patch) | |
tree | 9bb27d023ce9ffb868e6fe3a3acc1511e8fcc25a /t/app/controller | |
parent | fcc46472c7abd45cdafd2c3bcb6bc673ebd300b5 (diff) |
[Open311] Improve JSON output of controller.
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/open311.t | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/t/app/controller/open311.t b/t/app/controller/open311.t index 79fe159a3..c052605c7 100644 --- a/t/app/controller/open311.t +++ b/t/app/controller/open311.t @@ -14,7 +14,7 @@ $mech->content_contains('<status>open</status>'); $mech->get_ok('/open311/v2/requests.json?jurisdiction_id=foo&status=open&agency_responsible=2237'); my $json = decode_json($mech->content); -my $problems = $json->{requests}[0]{request}; +my $problems = $json->{service_requests}; is @$problems, 2; like $problems->[0]{description}, qr/Around page Test/; @@ -25,7 +25,7 @@ subtest "non_public reports aren't available" => sub { }); $mech->get_ok('/open311/v2/requests.json?jurisdiction_id=foo'); $json = decode_json($mech->content); - $problems = $json->{requests}[0]{request}; + $problems = $json->{service_requests}; is @$problems, 1; like $problems->[0]{description}, qr/Around page Test/; $mech->content_lacks('This report is now private'); @@ -33,7 +33,7 @@ subtest "non_public reports aren't available" => sub { my $problem_id = $problem1->id; $mech->get_ok("/open311/v2/requests/$problem_id.json?jurisdiction_id=foo"); $json = decode_json($mech->content); - $problems = $json->{requests}[0]{request}; + $problems = $json->{service_requests}; is @$problems, 0; }; @@ -45,7 +45,7 @@ subtest "hidden reports aren't available" => sub { }); $mech->get_ok('/open311/v2/requests.json?jurisdiction_id=foo'); $json = decode_json($mech->content); - $problems = $json->{requests}[0]{request}; + $problems = $json->{service_requests}; is @$problems, 1; like $problems->[0]{description}, qr/Around page Test/; $mech->content_lacks('This report is now hidden'); @@ -53,7 +53,7 @@ subtest "hidden reports aren't available" => sub { my $problem_id = $problem1->id; $mech->get_ok("/open311/v2/requests/$problem_id.json?jurisdiction_id=foo"); $json = decode_json($mech->content); - $problems = $json->{requests}[0]{request}; + $problems = $json->{service_requests}; is @$problems, 0; }; |