diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-06-21 10:10:08 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-06-21 22:49:14 +0100 |
commit | fac0142cd6230f5d9045ba4e6438ab3e328d808c (patch) | |
tree | de1913d2e7f98de68c6b5f5b79fe28765d69b074 /t/cobrand | |
parent | 7981c74546379a9ed78085158718e8d9c09a28f4 (diff) |
[UK] Improve server-side nearest road lookup.
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bexley.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/cobrand/bexley.t b/t/cobrand/bexley.t index 07d7ed91b..40908b869 100644 --- a/t/cobrand/bexley.t +++ b/t/cobrand/bexley.t @@ -112,4 +112,22 @@ FixMyStreet::override_config { }; +subtest 'nearest road returns correct road' => sub { + my $cobrand = FixMyStreet::Cobrand::Bexley->new; + my $cfg = { + accept_feature => sub { 1 }, + property => 'fid', + }; + my $features = [ + { geometry => { type => 'Polygon' } }, + { geometry => { type => 'MultiLineString', + coordinates => [ [ [ 545499, 174361 ], [ 545420, 174359 ], [ 545321, 174352 ] ] ] }, + properties => { fid => '20101226' } }, + { geometry => { type => 'LineString', + coordinates => [ [ 545420, 174359 ], [ 545419, 174375 ], [ 545418, 174380 ], [ 545415, 174391 ] ] }, + properties => { fid => '20100024' } }, + ]; + is $cobrand->_nearest_feature($cfg, 545451, 174380, $features), '20101226'; +}; + done_testing(); |