aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/auth_social.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-03-28 10:12:56 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-03-28 10:12:56 +0100
commitb76cfb3889140f1c771c1f98254f724aad3d4297 (patch)
treebb7beada7a603119ea2897f54a6af96814d850e1 /t/app/controller/auth_social.t
parent3f21a9742d89c3e4fda47a0be6ec2a17f802c99a (diff)
parenta8ceae6c99b00aefcba301b2f41033d84701f56a (diff)
Merge branch 'offline-tests'
Diffstat (limited to 't/app/controller/auth_social.t')
-rw-r--r--t/app/controller/auth_social.t9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/app/controller/auth_social.t b/t/app/controller/auth_social.t
index f3eae32a7..09fdf22d3 100644
--- a/t/app/controller/auth_social.t
+++ b/t/app/controller/auth_social.t
@@ -1,13 +1,13 @@
use strict;
use warnings;
use Test::More;
+use Test::MockModule;
use LWP::Protocol::PSGI;
use LWP::Simple;
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 +18,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',
@@ -30,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 {
@@ -138,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;