diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-18 13:59:20 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-20 07:37:52 +0100 |
commit | e133cdcfda4b25e3fd04db6febf663009add05bc (patch) | |
tree | a59dbc5856583869e9f62028c61d487c02c59247 /t/cobrand | |
parent | 14eab1f628ffb700ec7231f1f82aabbb2a4fbc5a (diff) |
[Bromley] Deal with partial postcodes in search.
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bromley.t | 17 | ||||
-rw-r--r-- | t/cobrand/fixamingata.t | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/t/cobrand/bromley.t b/t/cobrand/bromley.t index d62a0ad0f..6ee4be282 100644 --- a/t/cobrand/bromley.t +++ b/t/cobrand/bromley.t @@ -194,4 +194,21 @@ subtest 'check display of TfL reports' => sub { $mech->content_like(qr{<a title="Test Test[^>]*bromley.example.org[^>]*><img[^>]*yellow}); }; +subtest 'check geolocation overrides' => sub { + my $cobrand = FixMyStreet::Cobrand::Bromley->new; + foreach my $test ( + { query => 'Main Rd, BR1', town => 'Bromley', string => 'Main Rd' }, + { query => 'Main Rd, BR3', town => 'Beckenham', string => 'Main Rd' }, + { query => 'Main Rd, BR4', town => 'West Wickham', string => 'Main Rd' }, + { query => 'Main Rd, BR5', town => 'Orpington', string => 'Main Rd' }, + { query => 'Main Rd, BR7', town => 'Chislehurst', string => 'Main Rd' }, + { query => 'Main Rd, BR8', town => 'Swanley', string => 'Main Rd' }, + { query => 'Old Priory Avenue', town => 'BR6 0PL', string => 'Old Priory Avenue' }, + ) { + my $res = $cobrand->disambiguate_location($test->{query}); + is $res->{town}, $test->{town}, "Town matches $test->{town}"; + is $res->{string}, $test->{string}, "String matches $test->{string}"; + } +}; + done_testing(); diff --git a/t/cobrand/fixamingata.t b/t/cobrand/fixamingata.t index 0aa264660..d1f1dcec4 100644 --- a/t/cobrand/fixamingata.t +++ b/t/cobrand/fixamingata.t @@ -5,7 +5,6 @@ use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; use t::Mock::Nominatim; -LWP::Protocol::PSGI->register(t::Mock::Nominatim->to_psgi_app, host => 'nominatim.openstreetmap.org'); # Front page test |