diff options
author | Struan Donald <struan@exo.org.uk> | 2012-03-29 15:02:50 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-03-29 15:02:50 +0100 |
commit | b0a65005e25bd7c6a15f70f4e5db4a2dea99f176 (patch) | |
tree | eec84ceea162bd1d672b97a97d8536e1054ee003 | |
parent | b39e7396ce424b8b521707c9038e9ea1a2fc6c2d (diff) |
check extra values sending with requests
-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( { |