diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-16 14:55:45 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-19 16:11:08 +0100 |
commit | cc2ca7a697e1750ef197e222a1d45c4b345e61d4 (patch) | |
tree | 7db9414a7b0905ac72eb595eb3d8195840f22b79 /t/cobrand | |
parent | 5bf5c08a3a25c91866ce478f01fc6c4ad9d25eb6 (diff) |
[Bexley] Add new map tiles.
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bexley.t | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/cobrand/bexley.t b/t/cobrand/bexley.t index f227e7450..b929cbce1 100644 --- a/t/cobrand/bexley.t +++ b/t/cobrand/bexley.t @@ -4,6 +4,7 @@ use FixMyStreet::TestMech; use FixMyStreet::Script::Reports; use_ok 'FixMyStreet::Cobrand::Bexley'; +use_ok 'FixMyStreet::Map::Bexley'; my $ukc = Test::MockModule->new('FixMyStreet::Cobrand::UKCouncils'); $ukc->mock('lookup_site_code', sub { @@ -40,6 +41,7 @@ $category->update; FixMyStreet::override_config { ALLOWED_COBRANDS => [ 'bexley' ], MAPIT_URL => 'http://mapit.uk/', + MAP_TYPE => 'Bexley', STAGING_FLAGS => { send_reports => 1, skip_checks => 0 }, COBRAND_FEATURES => { open311_email => { bexley => { p1 => 'p1@bexley', lighting => 'thirdparty@notbexley.example.com' } } }, }, sub { @@ -147,4 +149,21 @@ subtest 'nearest road returns correct road' => sub { is $cobrand->_nearest_feature($cfg, 545451, 174380, $features), '20101226'; }; +subtest 'correct map tiles used' => sub { + my %test = ( + 16 => [ '-', 'oml' ], + 20 => [ '.', 'bexley' ] + ); + foreach my $zoom (qw(16 20)) { + my $tiles = FixMyStreet::Map::Bexley->map_tiles(x_tile => 123, y_tile => 456, zoom_act => $zoom); + my ($sep, $lyr) = @{$test{$zoom}}; + is_deeply $tiles, [ + "//a${sep}tilma.mysociety.org/$lyr/$zoom/122/455.png", + "//b${sep}tilma.mysociety.org/$lyr/$zoom/123/455.png", + "//c${sep}tilma.mysociety.org/$lyr/$zoom/122/456.png", + "//tilma.mysociety.org/$lyr/$zoom/123/456.png", + ]; + } +}; + done_testing(); |