diff options
-rw-r--r-- | t/open311.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/open311.t b/t/open311.t index 51cbf73a7..bec03f49e 100644 --- a/t/open311.t +++ b/t/open311.t @@ -92,7 +92,25 @@ EOT is $c->param('long'), 2, 'longitude correct'; is $c->param('description'), $description, 'descritpion correct'; is $c->param('service_code'), 'pothole', 'service code correct'; +}; + +subtest 'extra values in service request' => sub { + $problem->extra([ + { + name => 'title', + value => 'A title', + } + ]); + + my $extra = { + url => 'http://example.com/report/1', + }; + + my $results = make_service_req( $problem, $extra, $problem->category, '<?xml version="1.0" encoding="utf-8"?><service_requests><request><service_request_id>248</service_request_id></request></service_requests>' ); + my $req = $o->test_req_used; + my $c = CGI::Simple->new( $results->{ req }->content ); + is $c->param('attribute[title]'), 'A title', 'extra parameter used correctly'; }; my $comment = FixMyStreet::App->model('DB::Comment')->new( { |