-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HER-26-Improve-Phone-Number-Validation-for-Orders #28
HER-26-Improve-Phone-Number-Validation-for-Orders #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good, just remove commented out code and make the tests match your validations so that they pass.
normalize_phone_number was previously deleting any kind of 1 that began on a phone number, therefore truncating it, which was failing the tests. It now deletes any non numerical characters and checks that the phone number is 10 digits long, if not it deletes the 1 that usually people add for international calling from the US, therefore making it 10 digits long |
Sorry, I didn't realize I was holding you up. Don't forget to update branch. |
HER-26 Improve Phone Number Validation for Orders
Issue
As a user, I would like the Kit Request (Order) form to be more accepting of my phone number.
HER-27
Changes
1 - Changed the validation for a phone number to ensure 10 digits are entered
2 - Changed the validation for a school year to accept YYYY, YYYY-YY, or YYYY-YY format
3 - Added def normalize_phone_number to do a before_validation check that the phone number field is not blank, removes any characters that are not 0-9, and removes any leading 1
Review Checklist