diff options
author | Struan Donald <struan@exo.org.uk> | 2012-05-23 10:53:04 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-05-23 10:53:04 +0100 |
commit | 6f00ea0f96c25d81adf7e9e68a0228d193eb45d0 (patch) | |
tree | 7585e3d1af811fd7bb7b2b137bd522303fd95b29 /t | |
parent | 37887356e600137090aa9819816d659be19ce11c (diff) |
send address_id with NOTPINPOINTED to Bromley if not used map and no postcode
Diffstat (limited to 't')
-rw-r--r-- | t/open311.t | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/t/open311.t b/t/open311.t index 358a58a44..60757219e 100644 --- a/t/open311.t +++ b/t/open311.t @@ -349,6 +349,14 @@ for my $test ( postcode => '', used_map => 0, includes_latlong => 1, + }, + { + desc => 'no use lat long, no map and no postcode sends lat long', + use_latlong => 0, + notpinpoint => 1, + postcode => '', + used_map => 0, + includes_latlong => 0, } ) { subtest $test->{desc} => sub { @@ -361,14 +369,20 @@ for my $test ( $extra, $problem->category, '<?xml version="1.0" encoding="utf-8"?><service_requests><request><service_request_id>248</service_request_id></request></service_requests>', - { always_send_latlong => $test->{use_latlong} }, + { always_send_latlong => $test->{use_latlong}, + send_notpinpointed => $test->{notpinpoint} }, ); is $results->{ res }, 248, 'got request id'; my $c = CGI::Simple->new( $results->{ req }->content ); - if ( $test->{includes_latlong} ) { + if ( $test->{notpinpoint} ) { + is $c->param('lat'), undef, 'no latitude'; + is $c->param('long'), undef, 'no longitude'; + is $c->param('address_string'), undef, 'no address'; + is $c->param('address_id'), '#NOTPINPOINTED#', 'has not pinpointed'; + } elsif ( $test->{includes_latlong} ) { ok $c->param('lat'), 'has latitude'; ok $c->param('long'), 'has longitude'; is $c->param('address_string'), undef, 'no address'; |