-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
OmniAuth ready responses #507 #804
Closed
Closed
Conversation
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
I was failing travis because of two things:
I fixed both issues and now it looks like this is passing Travis CI and ready for review. Thanks for taking a look at this! |
Merged in e69921a |
Thanks @stympy! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request resolves OmniAuth ready responses #507
Faker::Internet::Omniauth.google
- Returns a randomized hash that mimics the auth hash described in the OmniAuth Google OAuth2 Strategy documentationFaker::Internet::Omniauth.linkedin
- Returns a randomized hash that mimics the auth hash described in the Omniauth LinedIn documenationFaker::Internet::Omniauth.twitter
- Returns a randomized hash that mimics the auth hash described in the Omniauth Twitter documentationFaker::Internet::Omniauth.facebook
- Returns a randomized hash that mimics the auth hash described in the Omniauth Facebook documentationMy testing approach was to write one test for each fake omniauth provider and one assertion for each key of each omniauth hash. Assertions range in specificity from least specific, checking data type, to most specific, checking value and or format.
I purposely chose to create an Omniauth subclass to the Internet class because first, that was described in the #507 issue description and also because Omniauth feels like a pretty niche use case that fits nicely under a more broad 'Internet' heading.
I strove for readability, though I recognize that I'm proposing adding a lengthy new class file. However, I think this is justified because most of the length is the natural result of the length of the authentication hashes being returned - as opposed to lengthy logic. Another approach would be to create separate modules for each omniauth type, but I think that adds unnecessary complexity at the scale of four omniauth providers. This might be an approach worth considering if future contributors build on this pull request and add additional providers.