blob: ee3c15ea8c585f3dc6fdb64eaf56edac1884938c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
|