diff options
author | Struan Donald <struan@exo.org.uk> | 2018-10-10 16:51:39 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-10-15 14:10:14 +0100 |
commit | adb976ce4b72d6c8747ccd578a9f1ff256531e15 (patch) | |
tree | 5d28561547393db64585049be5730fdb328a1d75 /t | |
parent | adf5b624149698a1da056b294f6ed6d85a868434 (diff) |
allow map zoom constants to be overridden
call ZOOM_LEVELS and MIN_ZOOM_LEVELS using self so that we can override
them in a subclass.
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/around.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/app/controller/around.t b/t/app/controller/around.t index 2d67dc6ac..8eeafec7f 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -1,3 +1,13 @@ +package FixMyStreet::Map::Tester; +use base 'FixMyStreet::Map::FMS'; + +use constant ZOOM_LEVELS => 99; +use constant MIN_ZOOM_LEVEL => 88; + +1; + +package main; + use Test::MockModule; use FixMyStreet::TestMech; @@ -279,4 +289,25 @@ subtest 'check skip_around skips around page' => sub { }; }; +subtest 'check map zoom level customisation' => sub { + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + MAP_TYPE => 'OSM', + }, sub { + $mech->get('/around?latitude=51.754926&longitude=-1.256179'); + $mech->content_contains('data-numZoomLevels=6'); + $mech->content_contains('data-zoomOffset=13'); + }; + + + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + MAP_TYPE => 'Tester', + }, sub { + $mech->get('/around?latitude=51.754926&longitude=-1.256179'); + $mech->content_contains('data-numZoomLevels=99'); + $mech->content_contains('data-zoomOffset=88'); + }; +}; + done_testing(); |