Skip to content
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

Fixes Email Validation #2506

Merged
merged 12 commits into from
Mar 21, 2018
Merged

Fixes Email Validation #2506

merged 12 commits into from
Mar 21, 2018

Conversation

namanjain1812
Copy link
Contributor

@namanjain1812 namanjain1812 commented Mar 16, 2018

Closes #1996
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.

Thanks!

@namanjain1812 namanjain1812 changed the title Fixes Email Validation #1996 Fixes Email Validation Mar 16, 2018
@PublicLabBot
Copy link

PublicLabBot commented Mar 16, 2018

2 Messages
📖 @namanjain1812 Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 Your pull request is on the master branch. Please make a separate feature branch) with a descriptive name like new-blog-design while making PRs in the future.

Generated by 🚫 Danger

@namanjain1812 namanjain1812 mentioned this pull request Mar 16, 2018
5 tasks
@namanjain1812
Copy link
Contributor Author

namanjain1812 commented Mar 16, 2018

@SidharthBansal Please merge it and thanks for all the help.
As my first contribution i learned a lot including the basics of Ruby,Regex
will like to contribute more in the future  😃
Thanks

@SidharthBansal
Copy link
Member

@namanjain1812 can you please update regex to /\A[-[:alnum:]+.]+@[[:alnum:]-.]+[.][[:alpha:]]+\z/ as we discussed in #2169 so that it will include the non-latin characters?
Also can you please add tests to check that validation errors are properly working.

Copy link
Member

@SidharthBansal SidharthBansal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the regex as per discussion in #2169 to /\A[-[:alnum:]+.]+@[[:alnum:]-.]+[.][[:alpha:]]+\z/
Refer rubular for regex if needed

@namanjain1812
Copy link
Contributor Author

namanjain1812 commented Mar 16, 2018

@SidharthBansal please review it.I have included 2 tests but i also tried adding a test including non-latin(chinese) words but Travis seems to not recognize them and hence gave checks failed message

@SidharthBansal
Copy link
Member

@namanjain1812 It looks great.
We can omit the test for non latin characters if they are making a problem with travis. What do you suggest @jywarren ?

SidharthBansal
SidharthBansal previously approved these changes Mar 17, 2018
user = User.new(username: 'zen',
password: 'nez',
password_confirmation: 'nez',
email: 'abc@xyz.com')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This email is valid and the user should be saved to the database.
What do you think @SidharthBansal?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed, you need to write it should not save to the database.
@seafr thanks

@seafr
Copy link
Member

seafr commented Mar 20, 2018

@SidharthBansal I agree with you regarding the tests for emails with non-latin characters. This is a FTO issue, and we can leave such tests for a subsequent PR.

@SidharthBansal SidharthBansal dismissed their stale review March 20, 2018 14:05

Please correct the test

@@ -182,7 +182,7 @@ class UserTest < ActiveSupport::TestCase
user = User.new(username: 'zen',
password: 'nez',
password_confirmation: 'nez',
email: 'abc@xyz.com')
email: 'abc@.com')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good.

@jywarren
Copy link
Member

Awesome -- is this good to go, then? Thanks, everybody!!! 👍 👍

@seafr
Copy link
Member

seafr commented Mar 21, 2018

Yes, I think so. The 'ready' label was removed due to that one test, which has since been fixed.

@jywarren jywarren merged commit 2169418 into publiclab:master Mar 21, 2018
@jywarren
Copy link
Member

Done, then!!! 🐯 👍 💯

@jywarren
Copy link
Member

Thanks everybody!!!!

@seafr
Copy link
Member

seafr commented Mar 22, 2018

@namanjain1812 congrats on your first PR and welcome to the community!

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* Update user.rb

* Update user.rb

* Update user.rb

* Update user.rb

* Update user_test.rb

* Update user_test.rb

* Update user_test.rb

* Update user_test.rb

* Update user_test.rb

* Update user_test.rb

* Update user_test.rb

* Update user_test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Email Validation
5 participants