diff options
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/contact_enquiry.t | 2 | ||||
-rw-r--r-- | t/cobrand/bexley.t | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/t/app/controller/contact_enquiry.t b/t/app/controller/contact_enquiry.t index 3f2989695..483289d5f 100644 --- a/t/app/controller/contact_enquiry.t +++ b/t/app/controller/contact_enquiry.t @@ -238,7 +238,7 @@ FixMyStreet::override_config { subtest 'Check Open311 sending of the above report' => sub { my $module = Test::MockModule->new('FixMyStreet::Cobrand::UKCouncils'); - $module->mock(get => sub ($) { '' }); + $module->mock(get => sub ($) { '{}' }); my $test_data = FixMyStreet::Script::Reports::send(); my $req = $test_data->{test_req_used}; my $found = 0; 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(); |