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/auth_social.t | 3 --- 1 file changed, 3 deletions(-) (limited to 't/app/controller/auth_social.t') diff --git a/t/app/controller/auth_social.t b/t/app/controller/auth_social.t index f3eae32a7..52cc2766c 100644 --- a/t/app/controller/auth_social.t +++ b/t/app/controller/auth_social.t @@ -7,7 +7,6 @@ use JSON::MaybeXS; use t::Mock::Facebook; use t::Mock::Twitter; -use t::Mock::MapIt; use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; @@ -18,8 +17,6 @@ END { FixMyStreet::App->log->enable('info'); } my ($report) = $mech->create_problems_for_body(1, '2345', 'Test'); -LWP::Protocol::PSGI->register(t::Mock::MapIt->to_psgi_app, host => 'mapit.uk'); - FixMyStreet::override_config { FACEBOOK_APP_ID => 'facebook-app-id', TWITTER_KEY => 'twitter-key', -- 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/auth_social.t | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't/app/controller/auth_social.t') diff --git a/t/app/controller/auth_social.t b/t/app/controller/auth_social.t index 52cc2766c..09fdf22d3 100644 --- a/t/app/controller/auth_social.t +++ b/t/app/controller/auth_social.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Test::MockModule; use LWP::Protocol::PSGI; use LWP::Simple; use JSON::MaybeXS; @@ -27,6 +28,9 @@ FixMyStreet::override_config { my $fb_email = 'facebook@example.org'; my $fb_uid = 123456789; +my $resolver = Test::MockModule->new('Email::Valid'); +$resolver->mock('address', sub { 'facebook@example.org' }); + for my $fb_state ( 'refused', 'no email', 'existing UID', 'okay' ) { for my $page ( 'my', 'report', 'update' ) { subtest "test FB '$fb_state' login for page '$page'" => sub { @@ -135,6 +139,8 @@ for my $fb_state ( 'refused', 'no email', 'existing UID', 'okay' ) { } } +$resolver->mock('address', sub { 'twitter@example.org' }); + my $tw_email = 'twitter@example.org'; my $tw_uid = 987654321; -- cgit v1.2.3