diff options
Diffstat (limited to 't/geocode/bing.t')
-rw-r--r-- | t/geocode/bing.t | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/geocode/bing.t b/t/geocode/bing.t new file mode 100644 index 000000000..32cffaa4e --- /dev/null +++ b/t/geocode/bing.t @@ -0,0 +1,24 @@ +use FixMyStreet::Test; +use FixMyStreet::Geocode::Bing; +use Catalyst::Test 'FixMyStreet::App'; +use t::Mock::Bing; + +my $c = ctx_request('/'); + +FixMyStreet::override_config { + GEOCODING_DISAMBIGUATION => { bing_culture => 'en-GB' } +}, sub { + my $r = FixMyStreet::Geocode::Bing->string('a result', $c); + ok $r->{latitude}; + ok $r->{longitude}; +}; + +FixMyStreet::override_config { + GEOCODING_DISAMBIGUATION => { bing_country => 'United Kingdom' } +}, sub { + my $r = FixMyStreet::Geocode::Bing->string('two results', $c); + is scalar @{$r->{error}}, 2; + is $r->{error}[1]{address}, 'Constitution Hill again, London'; +}; + +done_testing; |