-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TfL] Allow through TfL as a name if reporting as staff.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -416,6 +416,30 @@ subtest "test report creation anonymously by staff user" => sub { | |
$mech->log_out_ok; | ||
}; | ||
|
||
subtest "test report creation as body by staff user" => sub { | ||
$mech->log_in_ok( $staffuser->email ); | ||
$mech->get_ok('/around'); | ||
$mech->submit_form_ok( { with_fields => { pc => 'BR1 3UH', } }, "submit location" ); | ||
$mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" ); | ||
$mech->submit_form_ok({ with_fields => { | ||
title => 'Test Report 3', | ||
detail => 'Test report details.', | ||
category => 'Bus stops', | ||
} }, "submit report"); | ||
is_deeply $mech->page_errors, [], "check there were no errors"; | ||
|
||
my $report = FixMyStreet::DB->resultset("Problem")->find({ title => 'Test Report 3'}); | ||
ok $report, "Found the report"; | ||
is $report->name, 'TfL'; | ||
is $report->user->email, $staffuser->email; | ||
is $report->anonymous, 0; | ||
is $report->get_extra_metadata('contributed_as'), 'body'; | ||
|
||
$mech->content_contains('Your issue is on its way to Transport for London'); | ||
$mech->content_contains('Your reference for this report is FMS' . $report->id); | ||
$mech->log_out_ok; | ||
}; | ||
|
||
FixMyStreet::DB->resultset("Problem")->delete_all; | ||
|
||
my $tfl_staff = FixMyStreet::DB->resultset("User")->find({ email => '[email protected]'}); | ||
|