aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/auth_social.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-03-21 18:26:39 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-03-23 18:48:56 +0000
commit6713d6a4cd04a6e91743f687347367f070538e63 (patch)
treee74ca4f6044c79b30046dc9bb9d015e9f7d93548 /t/app/controller/auth_social.t
parent8bdf783d5d18dde25b4d2f8309a42c6096cf09d3 (diff)
Make sure all MapIt tests can run offline.
Diffstat (limited to 't/app/controller/auth_social.t')
-rw-r--r--t/app/controller/auth_social.t6
1 files changed, 6 insertions, 0 deletions
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;