-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix allows admin to edit user with verified landline
#3295 * Stops validation of phone number on user edit if edit does not change phone number * Adds test to check changing name does not revalidate phone number so edit is successful * Adds test to check that changing the number revalidates the phone number
- Loading branch information
1 parent
6938275
commit 728d20a
Showing
3 changed files
with
23 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -550,6 +550,26 @@ FixMyStreet::override_config { | |
$mech->content_contains( 'Updated!' ); | ||
}; | ||
|
||
subtest "Test edit user name who has verified landline" => sub { | ||
my $existing_user = $mech->create_user_ok('[email protected]', name => 'Existing User', phone => '01184960017', phone_verified => 1 ); | ||
$mech->get_ok( '/admin/users/' . $existing_user->id ); | ||
$mech->submit_form_ok( { with_fields => { | ||
name => 'Existing E. User', | ||
} } ); | ||
$mech->content_contains( 'Updated!' ); | ||
}; | ||
|
||
subtest "Test edit user number who has verified landline" => sub { | ||
my $existing_user = $mech->create_user_ok('[email protected]', name => 'Existing User', phone => '01184960017', phone_verified => 1 ); | ||
$mech->get_ok( '/admin/users/' . $existing_user->id ); | ||
$mech->submit_form_ok( { with_fields => { | ||
phone => '01184960018', | ||
} } ); | ||
$mech->content_lacks( 'Updated!' ); | ||
}; | ||
|
||
|
||
|
||
subtest "Test changing user to an existing one" => sub { | ||
my $existing_user = $mech->create_user_ok('[email protected]', name => 'Existing User'); | ||
$mech->create_problems_for_body(2, 2514, 'Title', { user => $existing_user }); | ||
|