diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-02-12 17:11:58 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-02-12 17:11:58 +0000 |
commit | 236f615c046dfcfadbba376b735ef7a352a79ef9 (patch) | |
tree | 5dd6c4d18e892cce26e90285c6a7f2d7eab4e9e7 /t/geocode/google.t | |
parent | 5260280b60a1192f87987c34a78fce63fc5c1d26 (diff) | |
parent | 7ec0d3f67766764967a8bb92099c582f8bd6aaf5 (diff) |
Merge branch 'banes-improvements-grab-bag'
Diffstat (limited to 't/geocode/google.t')
-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; |