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.
Assignment Submission: Media Ranker Revisited
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
routes.rb
. (5) Modify the 'login' button in the view template to route to the appropriate provider login route. (6) Add a definition for the create action so the callback route can run the create action, checking for an existingUser
in the database, otherwise creating a new instance with the information retrieved in the Omniauth hash. (7) Generate and run a migration to ensure the necessary attributes for unique user identification with the provider are attributes of ourUser
model (in our case, at leastuid
andprovider
).Users
controller tests I wrote for the first Media Ranker project. If I had written tests and had restricted site access based on user authorization, I would have written several more tests (and removed irrelevant tests). I would have tests that checked if logged in users were able to access authorized areas (ie. received a success status code) and guests received a redirect, or some other status code per the controller action that checks the user's authorization credentials. If I had not restricted site access, I still would have written additional tests for the create controller action, ensuring that a newUser
is only created if the user had not previously logged in to our site with that Github account, done via mocking.