aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/app/controller/auth_social.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/app/controller/auth_social.t b/t/app/controller/auth_social.t
index 86aa92022..160d46f8f 100644
--- a/t/app/controller/auth_social.t
+++ b/t/app/controller/auth_social.t
@@ -16,7 +16,7 @@ END { FixMyStreet::App->log->enable('info'); }
my $body = $mech->create_body_ok(2504, 'Westminster Council');
-my ($report) = $mech->create_problems_for_body(1, $body->id, 'Test');
+my ($report) = $mech->create_problems_for_body(1, $body->id, 'My Test Report');
my $contact = $mech->create_contact_ok(
body_id => $body->id, category => 'Damaged bin', email => 'BIN',
@@ -108,6 +108,11 @@ for my $state ( 'refused', 'no email', 'existing UID', 'okay' ) {
} else {
$mech->delete_user($test->{email});
}
+ if ($page eq 'my' && $state eq 'existing UID') {
+ $report->update({ user_id => FixMyStreet::App->model( 'DB::User' )->find( { email => $test->{email} } )->id });
+ } else {
+ $report->update({ user_id => FixMyStreet::App->model( 'DB::User' )->find( { email => 'test@example.com' } )->id });
+ }
# Set up a mock to catch (most, see below) requests to the OAuth API
my $mock_api = $test->{mock}->new;
@@ -231,6 +236,11 @@ for my $state ( 'refused', 'no email', 'existing UID', 'okay' ) {
is $user->get_extra_metadata($k), $v, "User has correct $k extra field";
}
}
+ if ($state eq 'existing UID') {
+ my $report_id = $report->id;
+ $mech->content_contains( $report->title );
+ $mech->content_contains( "/report/$report_id" );
+ }
}
$mech->get('/auth/sign_out');