diff options
Diffstat (limited to 't')
-rw-r--r-- | t/Mock/MapIt.pm | 1 | ||||
-rw-r--r-- | t/Mock/OpenIDConnect.pm | 2 | ||||
-rw-r--r-- | t/cobrand/tfl.t | 27 |
3 files changed, 20 insertions, 10 deletions
diff --git a/t/Mock/MapIt.pm b/t/Mock/MapIt.pm index cd441856a..7dafb7af5 100644 --- a/t/Mock/MapIt.pm +++ b/t/Mock/MapIt.pm @@ -55,6 +55,7 @@ my @PLACES = ( [ 'PE1 1HF', 52.57146, -0.24201, 2566, 'Peterborough City Council', 'UTA' ], [ 'OX28 4DS', 51.784721, -1.494453 ], [ 'E14 2DN', 51.508536, '0.000001' ], + [ '?', 52.51093, -1.86514, 11809, 'West Midlands', 'EUR' ], # Norway [ '3290', 59, 10, 709, 'Larvik', 'NKO', 7, 'Vestfold', 'NFY' ], [ '0045', "59.9", "10.9", 301, 'Oslo', 'NKO', 3, 'Oslo', 'NFY' ], diff --git a/t/Mock/OpenIDConnect.pm b/t/Mock/OpenIDConnect.pm index 1a1428758..ba7d03b1d 100644 --- a/t/Mock/OpenIDConnect.pm +++ b/t/Mock/OpenIDConnect.pm @@ -55,7 +55,7 @@ sub dispatch_request { extension_CrmContactId => "1c304134-ef12-c128-9212-123908123901", nonce => 'MyAwesomeRandomValue', }; - $payload->{emails} = ['pkg-tappcontrollerauth_social.t-oidc@example.org'] if $self->returns_email; + $payload->{emails} = ['pkg-tappcontrollerauth_socialt-oidc@example.org'] if $self->returns_email; my $signature = "dummy"; my $id_token = join(".", ( encode_base64($self->json->encode($header), ''), diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t index 61d851422..24185993b 100644 --- a/t/cobrand/tfl.t +++ b/t/cobrand/tfl.t @@ -592,15 +592,24 @@ subtest 'TfL admin allows inspectors to be assigned to borough areas' => sub { $staffuser->update({ area_ids => undef}); # so login below doesn't break }; -subtest 'Leave an update on a shortlisted report, get an email' => sub { - my $report = FixMyStreet::DB->resultset("Problem")->find({ title => 'Test Report 1'}); - $staffuser->add_to_planned_reports($report); - $mech->log_in_ok( $user->email ); - $mech->get_ok('/report/' . $report->id); - $mech->submit_form_ok({ with_fields => { update => 'This is an update' }}); - my $email = $mech->get_text_body_from_email; - like $email, qr/This is an update/; -}; +my $report = FixMyStreet::DB->resultset("Problem")->find({ title => 'Test Report 1'}); +$report->update({ cobrand => 'fixmystreet' }); +$staffuser->add_to_planned_reports($report); + +for my $host ( 'www.fixmystreet.com', 'tfl.fixmystreet.com' ) { + subtest "Leave an update on a shortlisted report on $host, get an email" => sub { + $mech->host($host); + $mech->log_in_ok( $user->email ); + $mech->get_ok('/report/' . $report->id); + $mech->submit_form_ok({ with_fields => { update => 'This is an update' }}); + my $email = $mech->get_email; + my $text = $mech->get_text_body_from_email; + like $text, qr/This is an update/, 'Right email'; + like $text, qr/street.tfl/, 'Right url'; + like $text, qr/Street Care/, 'Right name'; + like $email->as_string, qr/iEYI87gX6Upb\+tKYzrSmN83pTnv606AOtahHTepSm/, 'Right logo'; + }; +} subtest 'TfL staff can access TfL admin' => sub { $mech->log_in_ok( $staffuser->email ); |