From 8bdf783d5d18dde25b4d2f8309a42c6096cf09d3 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 21 Mar 2017 17:23:07 +0000 Subject: Always include MapIt mock handler in all tests. --- t/app/controller/around.t | 4 ---- 1 file changed, 4 deletions(-) (limited to 't/app/controller/around.t') diff --git a/t/app/controller/around.t b/t/app/controller/around.t index 9e2e7c524..eece843a8 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -1,9 +1,7 @@ use strict; use warnings; use Test::More; -use LWP::Protocol::PSGI; -use t::Mock::MapIt; use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; @@ -84,8 +82,6 @@ foreach my $test ( ) { subtest "check lat/lng for '$test->{pc}'" => sub { - LWP::Protocol::PSGI->register(t::Mock::MapIt->run_if_script, host => 'mapit.uk'); - $mech->get_ok('/'); FixMyStreet::override_config { ALLOWED_COBRANDS => [ { 'fixmystreet' => '.' } ], -- cgit v1.2.3 From 6713d6a4cd04a6e91743f687347367f070538e63 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 21 Mar 2017 18:26:39 +0000 Subject: Make sure all MapIt tests can run offline. --- t/app/controller/around.t | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 't/app/controller/around.t') diff --git a/t/app/controller/around.t b/t/app/controller/around.t index eece843a8..c8aca04aa 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -15,7 +15,7 @@ subtest "check that if no query we get sent back to the homepage" => sub { subtest "redirect x,y requests to lat/lon (301 - permanent)" => sub { FixMyStreet::override_config { - MAPIT_URL => 'http://mapit.mysociety.org/', + MAPIT_URL => 'http://mapit.uk/', }, sub { $mech->get_ok('/around?x=3281&y=1113'); }; @@ -71,8 +71,8 @@ foreach my $test ( foreach my $test ( { pc => 'SW1A 1AA', - latitude => '51.5', - longitude => '-2.1', + latitude => '51.501009', + longitude => '-0.141588', }, { pc => 'TQ 388 773', @@ -98,7 +98,7 @@ foreach my $test ( subtest 'check non public reports are not displayed on around page' => sub { my $params = { - postcode => 'EH99 1SP', + postcode => 'EH1 1BB', latitude => 55.9519637512, longitude => -3.17492254484, }; @@ -108,9 +108,9 @@ subtest 'check non public reports are not displayed on around page' => sub { $mech->get_ok('/'); FixMyStreet::override_config { ALLOWED_COBRANDS => [ { 'fixmystreet' => '.' } ], - MAPIT_URL => 'http://mapit.mysociety.org/', + MAPIT_URL => 'http://mapit.uk/', }, sub { - $mech->submit_form_ok( { with_fields => { pc => 'EH99 1SP' } }, + $mech->submit_form_ok( { with_fields => { pc => 'EH1 1BB' } }, "good location" ); }; $mech->content_contains( 'Around page Test 3 for 2651', @@ -122,9 +122,9 @@ subtest 'check non public reports are not displayed on around page' => sub { $mech->get_ok('/'); FixMyStreet::override_config { ALLOWED_COBRANDS => [ { 'fixmystreet' => '.' } ], - MAPIT_URL => 'http://mapit.mysociety.org/', + MAPIT_URL => 'http://mapit.uk/', }, sub { - $mech->submit_form_ok( { with_fields => { pc => 'EH99 1SP' } }, + $mech->submit_form_ok( { with_fields => { pc => 'EH1 1BB' } }, "good location" ); }; $mech->content_lacks( 'Around page Test 3 for 2651', -- cgit v1.2.3