aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/open311.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2018-06-07 13:28:45 +0200
committerMarius Halden <marius.h@lden.org>2018-06-07 13:28:45 +0200
commit956f8b8a065824f9a9dc379eba1d0aa8b1b669cf (patch)
tree49f9ccb147b18dddee97500d4df7a3fb3dd3737c /t/app/controller/open311.t
parent782457d016084c8de04989dbc824a71899f8b41b (diff)
parent4dbf5371f79c5f290c08e561ba2c881e96b58669 (diff)
Merge tag 'v2.3.3' into fiksgatami-dev
Diffstat (limited to 't/app/controller/open311.t')
-rw-r--r--t/app/controller/open311.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/app/controller/open311.t b/t/app/controller/open311.t
index 29cd38129..9f4f594fe 100644
--- a/t/app/controller/open311.t
+++ b/t/app/controller/open311.t
@@ -1,3 +1,4 @@
+use JSON::MaybeXS;
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
@@ -5,4 +6,16 @@ my $mech = FixMyStreet::TestMech->new;
$mech->get_ok('/open311.cgi/v2/requests.rss?jurisdiction_id=fiksgatami.no&status=open&agency_responsible=1854');
like $mech->uri, qr[/open311/v2/requests\.rss\?.{65}]; # Don't know order parameters will be in now
+$mech->create_problems_for_body(2, 2237, 'Around page');
+$mech->get_ok('/open311/v2/requests.xml?jurisdiction_id=foo&status=open&agency_responsible=2237');
+$mech->content_contains('<description>Around page Test 2 for 2237: Around page Test 2 for 2237 Detail</description>');
+$mech->content_contains('<interface_used>Web interface</interface_used>');
+$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};
+is @$problems, 2;
+like $problems->[0]{description}, qr/Around page Test/;
+
done_testing();