-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! [Island Roads] Default 'CONFIRM Subject' to be a blank selection
- Loading branch information
1 parent
0e5c67e
commit c3c9d74
Showing
2 changed files
with
65 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ $contact->set_extra_fields( ( { | |
order => 1, | ||
datatype_description => 'datatype', | ||
} ) ); | ||
$contact->set_extra_metadata( group => ['Roads'] ); | ||
$contact->update; | ||
|
||
my $user = $mech->create_user_ok('[email protected]', name => 'Test User'); | ||
|
@@ -67,6 +68,10 @@ $admin_user->user_body_permissions->create({ | |
body => $isleofwight, | ||
permission_type => 'triage' | ||
}); | ||
$admin_user->user_body_permissions->create({ | ||
body => $isleofwight, | ||
permission_type => 'report_inspect', | ||
}); | ||
|
||
my @reports = $mech->create_problems_for_body(1, $isleofwight->id, 'An Isle of wight report', { | ||
confirmed => '2019-10-25 09:00', | ||
|
@@ -590,6 +595,37 @@ subtest "reports are marked for triage upon submission" => sub { | |
my $email = $mech->get_email; | ||
like $mech->get_text_body_from_email($email), | ||
qr/submitted to Island Roads for review/, 'correct text for email sent for Triage'; | ||
|
||
$mech->log_in_ok( $admin_user->email ); | ||
$mech->get_ok( '/report/' . $report->id ); | ||
$mech->content_contains( | ||
'<optgroup label="Roads">', | ||
'there is a "Roads" optgroup', | ||
); | ||
$mech->content_contains( | ||
'<option value="" selected>-- Please select --</option>', | ||
'there is an empty-valued option selected by default', | ||
); | ||
|
||
$mech->submit_form( form_id => 'report_inspect_form' ); | ||
$mech->text_contains( 'Please choose a category', | ||
'Form requires a category be chosen' ); | ||
|
||
$mech->submit_form( | ||
form_id => 'report_inspect_form', | ||
fields => { category => 1 }, # Pothole | ||
); | ||
$mech->get_ok( '/report/' . $report->id ); | ||
$mech->text_contains( | ||
'Report triaged from Roads to Potholes', | ||
'Update message describes triage', | ||
); | ||
$mech->content_contains( | ||
'<option value="Potholes" selected>', | ||
'Potholes selected as category', | ||
); | ||
$mech->content_lacks( '-- Please select --', | ||
'No blank category available anymore' ); | ||
}; | ||
}; | ||
|
||
|
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