-
Notifications
You must be signed in to change notification settings - Fork 25
Sammi Jo & LJ Video Store API #23
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
base: master
Are you sure you want to change the base?
Conversation
…ble inventory to rentals table
…reset for all fixes
…te.current in every instance
…ue_path passes test
…ns in prep for sorting new endpoints
Video StoreWhat We're Looking For
|
| rental_out3: | ||
| checkout_date: 2018-11-05 | ||
| checkin_date: | ||
| due_date: Date.current + 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work setting due dates in the future. 😁
| overdue_rentals = Rental.includes(:movie).includes(:customer).where(checkin_date: nil).where("rentals.due_date < ?", Date.current) | ||
|
|
||
| # @sorters will always be a 1-d ordered array of unique values. | ||
| @sorters.each do |sorter| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of logic would make an excellent candidate for a model method.
|
@CheezItMan Thanks for the feedback! 1. I was wondering if you can give an example of where we could be more thorough with negative tests. 2. We forgot to note this in our pull request comprehension questions, but we edited the variable name in the smoke test JSON (duplicated in the /test folder) to make it pass (though I see why we should have followed the test and renamed our column) |
| # post check_in_path, params: rental, as: :json | ||
| # end.wont_change 'Rental.count' | ||
|
|
||
| get "/customers/#{id}/history", as: :json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use a named path, and add a test with an invalid id.
| # return movie to provide a history | ||
| post check_in_path, params: rental, as: :json | ||
|
|
||
| get "/movies/#{id}/history", as: :json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto with the previous comments
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
POST /rentals/check-inendpoint? What does the time complexity depend on? Explain your reasoning.