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

Ampers Mary and Zheng #5

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open

Ampers Mary and Zheng #5

wants to merge 40 commits into from

Conversation

mmlamkin
Copy link

Video Store API

Congratulations! You're submitting your assignment!
If you didn't get to the functionality the question is asking about, reply with what you would have done if you had completed it.

Comprehension Questions

Question Answer
Explain how you came up with the design of your ERD, based on the seed data. We created the customer and movie tables based on seed data and the tables presented in the project overview. When we read about rentals we made the table as a join table between customers and movies, but with a model. Originally we had checkout and due date along with the foreign keys, but we later added status to help us keep track of the rentals to make it easier for custom methods to keep track of rentals.
Describe a set of positive and negative test cases you implemented for a model. For movie (as well as the other models) in order to test validations, we first tested a nominal case with all required fields to ensure that this value was valid. We then changed one field at a time to either nil or another invalid value and then tested to ensure that this value was not valid.
Describe a set of positive and negative test cases you implemented for a controller. In the create movie controller action, we tested that with valid parameters a movie could be created and that it would successfully save in the database. We then tested that without all necessary parameters the movie would not be saved in the database and would respond with bad_request
How does your API respond when bad data is sent to it? Our API responds with bad_request as well as a hash of error messages depending on what bad data.
Describe one of your custom model methods and why you chose to wrap that functionality into a method. In the customer model we created a method called movies_checked_out_count. This counts the number of rentals with a checked out status for a particular customer. This also would have been possible to have as a field in the database, but we felt that since it changes often, it was better suited for a model method.
Do you have any recommendations on how we could improve this project for the next cohort? It seemed like many people had issues fully understanding postman. It would have been helpful to have a demo about tests written in postman and how to inspect them in order to debug our projects.
Link to Trello https://trello.com/b/POtIrZe6/videostoreapi
Link to ERD https://www.lucidchart.com/documents/edit/70e769bd-55c2-41d5-9eab-1d3981672fab/0

mmlamkin and others added 30 commits May 7, 2018 12:44
@CheezItMan
Copy link

Video Store

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits, good commit messages, both team members contributed.
Comprehension questions Check
General
Business Logic in Models Check, nicely done
All required endpoints return expected JSON data Check
Requests respond with appropriate HTTP Status Code Check
Errors are reported Check
Testing
Passes all Smoke Tests Check
Model Tests - all relations, validations, and custom functions test positive & negative cases Check
Controller Tests - URI parameters and data in the request body have positive & negative cases Check, I did leave a note with one of your rental controller tests.
Overall You hit all the major learning goals. Great work, congratulations, you've finished Rails.

}
}

it "changes the status of the rental to returned and returns customer_id and movie_id in request body if given valid params" do

Choose a reason for hiding this comment

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

What about checking in a movie without having it checked out first.

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.

3 participants