diff options
author | Dave Arter <davea@mysociety.org> | 2019-07-23 15:02:45 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2019-08-16 14:25:12 +0100 |
commit | bef9123a6477ab5c96bf3e86b070a9ce0e91b2c6 (patch) | |
tree | 73f540b20e8f1351037560b00f1e77926acc005b /t/open311.t | |
parent | 1165ca9c88ef65fc46a911cd770d71236f4f2b35 (diff) |
[Open311] Include account_id in POST Service Requests if present
Diffstat (limited to 't/open311.t')
-rw-r--r-- | t/open311.t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/open311.t b/t/open311.t index 73bb488d5..9524006b8 100644 --- a/t/open311.t +++ b/t/open311.t @@ -263,6 +263,36 @@ for my $test ( }; } +for my $test ( + { + desc => 'account_id handled correctly when present', + account_id => '1c304134-ef12-c128-9212-123908123901', + }, + { + desc => 'account_id handled correctly when 0', + account_id => '0' + }, + { + desc => 'account_id handled correctly when missing', + account_id => undef + } +) { + subtest $test->{desc} => sub { + $problem->extra( undef ); + my $extra = { + url => 'http://example.com/report/1', + defined $test->{account_id} ? ( account_id => $test->{account_id} ) : () + }; + + 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 $c = CGI::Simple->new( $results->{req}->content ); + + is $c->param( 'account_id' ), $test->{account_id}, 'correct account_id'; + }; +} + subtest 'test always_send_email' => sub { my $email = $user->email; $user->email(undef); |