- Add tests to controllers to verify controller logic
- Practice using OAuth in a web application
- Practice using Session variables to track a user across multiple HTTP requests
We are providing you with an implementation of MediaRanker. Use this MediaRanker to begin this project.
Our MediaRanker web app was a wonderful website with two major flaws:
- our controllers are untested
- the way we implemented user login is extremely insecure
In this assignment you will modify Media Ranker in two ways:
- our controllers will finally have tests that test controller logic
- our web app can securely authenticate multiple users via OAuth and authorize them to view, manage and vote on works
Build your project using branches, with at least one branch per wave. As you finish a wave merge the changes into the main branch. Submit one pull request at the end once you are complete.
Take some time to understand what each controller is doing. Add tests to the existing controllers in this project. Be sure to consider both nominal and edge cases for every user flow possible.
- Tests on CRUD operations that your controller can execute
- Create
- What should happen if the controller executes creation of something with valid data?
- ... with invalid data?
- Read (Show)
- What should happen if the controller tries to read/show an ID of a model that exists in the DB?
- ... that doesn't exist in the DB?
- Update
- What should happen if the controller executes an update of something with valid data?
- ... with invalid data?
- Delete
- What should happen if the controller tries to delete an ID of a model that exists in the DB?
- ... that doesn't exist in the DB?
- Create
- Tests rendering, routing, and HTTP status when appropriate
- Tests updates to the model when appropriate
- Tests custom controller logic and custom routes when appropriate
- Tests positive, negative, nominal and edge cases
This project is due before class Monday October 29 via PR against Ada-C10/MediaRanker-Revisited.