diff options
author | Marius Halden <marius.h@lden.org> | 2018-05-29 19:37:34 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2018-05-29 19:37:34 +0200 |
commit | 782457d016084c8de04989dbc824a71899f8b41b (patch) | |
tree | 56d14e1a988396e43c8693ff3486e40d16962add /t/geocode | |
parent | 140d40e3eab4cb1e7aa9f95cbc24a0f13180b606 (diff) | |
parent | 6e2da95bc6a758c0cf070b9ddd51acc769f7acf1 (diff) |
Merge tag 'v2.3.1' into fiksgatami-dev
Diffstat (limited to 't/geocode')
-rw-r--r-- | t/geocode/google.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/geocode/google.t b/t/geocode/google.t new file mode 100644 index 000000000..ee3c15ea8 --- /dev/null +++ b/t/geocode/google.t @@ -0,0 +1,22 @@ +package FixMyStreet::Cobrand::Tester; +use parent 'FixMyStreet::Cobrand::Default'; +sub country { 'GB' } +sub disambiguate_location { { components => 'country:IE' } } + +package main; + +use FixMyStreet::Test; +use FixMyStreet::Geocode::Google; +use Catalyst::Test 'FixMyStreet::App'; +use t::Mock::GoogleGeocoder; + +my $c = ctx_request('/'); +my $r = FixMyStreet::Geocode::Google::string("one result", $c); +ok $r->{latitude}; +ok $r->{longitude}; + +$c->stash->{cobrand} = FixMyStreet::Cobrand::Tester->new; +$r = FixMyStreet::Geocode::Google::string("two results", $c); +is scalar @{$r->{error}}, 2; + +done_testing; |