diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-25 15:16:13 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-25 15:16:13 +0000 |
commit | 777a1b20b93b3b00030925faa682d84fc668ee0c (patch) | |
tree | 59497fb3c627d6755a4df73228c9f56409297c2a /t | |
parent | aa7dc8b25d8d267752e7654868ec5f4bf4e7565e (diff) | |
parent | fa50dc502b2049b331cf7ddf27c536b4100c3129 (diff) |
Merge remote-tracking branch 'origin/issues/commercial/1229-duplicate-reporting'
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/around.t | 6 | ||||
-rw-r--r-- | t/cobrand/restriction.t | 2 | ||||
-rw-r--r-- | t/map/tilma/original.t | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/t/app/controller/around.t b/t/app/controller/around.t index ed29d438c..3f0fff666 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -359,4 +359,10 @@ subtest 'check map zoom level customisation' => sub { }; }; +subtest 'check nearby lookup' => sub { + my $p = FixMyStreet::DB->resultset("Problem")->search({ external_body => "Pothole-confirmed" })->first; + $mech->get_ok('/around/nearby?latitude=51.754926&longitude=-1.256179&filter_category=Pothole'); + $mech->content_contains('["51.754926","-1.256179","yellow",' . $p->id . ',"Around page Test 1 for ' . $body->id . '","small",false]'); +}; + done_testing(); diff --git a/t/cobrand/restriction.t b/t/cobrand/restriction.t index 9e3018625..63fe326b1 100644 --- a/t/cobrand/restriction.t +++ b/t/cobrand/restriction.t @@ -47,7 +47,7 @@ is($c->model('DB::Problem')->count, 4, 'Four reports in database'); is($cobrand->problems->count, 2, 'Two reports in the right cobrand'); is($cobrand->updates->count, 1, 'One update in the right cobrand'); -my $nearby = $c->model('DB::Nearby')->nearby($c, 5, [], 10, 0.003, 0.004); +my $nearby = $c->model('DB::Nearby')->nearby($c, distance => 5, ids => [], limit => 10, latitude => 0.003, longitude => 0.004); is(@$nearby, 1, 'One report close to the origin point'); done_testing(); diff --git a/t/map/tilma/original.t b/t/map/tilma/original.t index 42cbbd9f2..9a404a2c9 100644 --- a/t/map/tilma/original.t +++ b/t/map/tilma/original.t @@ -93,12 +93,10 @@ for my $test ( $report->update; $c->stash->{report_age_field} = 'lastupdate'; - my ( $on_map, $nearby, $dist ) = - FixMyStreet::Map::map_features($c, bbox => "0,0,0,0"); + my ($on_map, $nearby) = FixMyStreet::Map::map_features($c, bbox => "0,0,0,0"); ok $on_map; ok $nearby; - ok $dist; my $id = $report->id; my $colour = $test->{colour}; |