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

Modify email method in Internet class #1259

Merged
merged 2 commits into from
May 30, 2018
Merged

Modify email method in Internet class #1259

merged 2 commits into from
May 30, 2018

Conversation

aamarill
Copy link

This PR is for the feature request in issue #1178.

The PR does:

  1. Add feature request.
  2. Describe feature in documentation.
  3. Add a test for the new feature.

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

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

Could you update the changelog and take a look at the comment that I wrote?

[user_name(name, separators), domain_name].join('@')
else
[user_name(name), domain_name].join('@')
end
Copy link
Member

@vbrazo vbrazo May 28, 2018

Choose a reason for hiding this comment

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

I think you should create two tests because you have two scenarios.

I added a new rake task. I don't know if I told you: rake coverage_report. By running this command, you can see the code coverage report.

Copy link
Author

Choose a reason for hiding this comment

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

There was a test already in place to test the else case. I only added the first scenario, which is why only one test was needed. Also, running rake coverage_report opens up a page in my browser and shoes me coverage report. I don't get a report on the terminal. Is this how it's supposed to work?

Copy link
Member

Choose a reason for hiding this comment

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

I didn't see the test for the else statement. Let me check it out.

Copy link
Member

Choose a reason for hiding this comment

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

doh it's correct 👍 sorry about that

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

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

Overall looks good 🥇

Faker::Internet.email #=> "[email protected]"

Faker::Internet.email('Nancy') #=> "[email protected]"

Faker::Internet.email('Janelle Santiago', '+') #=> [email protected]"

Copy link
Member

@vbrazo vbrazo May 30, 2018

Choose a reason for hiding this comment

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

What do you think about adding a whitelist for these separators? We know that there are special characters that aren't accepted in emails.

screen shot 2018-05-30 at 11 50 41 am

I think it could be a bit dangerous if people seed their staging database and add wrong separators accidentally 😆

Copy link
Author

Choose a reason for hiding this comment

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

I wonder if these are Google's specific restrictions. It looks like this is a larger topic than I expected. And from stack overflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

I say skip the whitelist... if people are using the optional argument to add separators, then it's up to them to wield the sharp knife safely. :)

Copy link
Member

Choose a reason for hiding this comment

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

yeah if we don't do that, we could focus on other features and bugs

@vbrazo vbrazo merged commit d2d2b27 into faker-ruby:master May 30, 2018
@vbrazo vbrazo self-requested a review July 19, 2018 01:24
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
* Modify email method in Internet class

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

Successfully merging this pull request may close these issues.

3 participants