-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
4486: address pickup email issues #4648
4486: address pickup email issues #4648
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.
Non-blocking comment. Thanks for the contribution!
@cielf did you want to test? |
Yeah, I think I should. |
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.
@dariuspirvulescu I entered "[email protected]. Call first" when updating a partner profile. It saved it, with no error. That doesn't seem right to me. Similarly "Call first [email protected]"
[Note: I have not yet done the tests against prod that we need to do before merging.] |
Thanks for testing. I'm wondering if you would want me to modify the input component, maybe change "Person's -> Persons" or add a tooltip informing users to comma separate email addresses ([email protected], [email protected]) |
We should put something about the format.... Maybe just add "(comma-separated if multiple addresses) to the label? |
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.
It looks pretty good to me. There's one edge case that I want to check if it exists in the wile (waiting for approval with a bad email address), which will hold this up a bit. (edit we do have one. so need to test with that prod data)
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.
Hrm. If you already have a bad email it will let you approve (Approving changes the partner record, not the profile record, so it's not re-saving that).
However, there's only one case that has been saved with bad email and is waiting for approval. We can probably live with that -- I can reach out to the bank. @dorner -- are you good with that, or should we make the change?
I think the bank should be able to fix it if it's just one case. |
(nods) There are other ones that are bad -- just not in that status. |
@dariuspirvulescu: Your PR |
Resolves #4486
Description
This PR adds validation for
Partner::Profile.pick_up_email
. This field is a plain string and the lack of validation caused messy data.The
pick_up_email
field should accept multiple comma-separated email addresses, not more than 3, and with optional whitespace between the addresses.The validation checks this and if every email is in a valid format (using
URI::MailTo::EMAIL_REGEXP
).Type of change
How Has This Been Tested?
pick_up_email
model validation inprofile_spec.rb
bundle exec rspec spec/models/partners/profile_spec.rb
orbundle exec rspec spec/models/partners/profile_spec.rb:170
distribution_mailer_spec.rb
to handle multiplepick_up_email
addressesbundle exec rspec spec/mailers/distribution_mailer_spec.rb
I am not experienced with testing and I could definitely use some help, any suggestion is more than welcome.
Screenshots