-
Notifications
You must be signed in to change notification settings - Fork 26
Tatiana and Amy W #25
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
describe block
Customer model tests (can delete when merged)
Movie model test
Customer controller tests and CRUD
Movie controller
updated for fields that only need to be returned
Rentals Checkin
Rental tq
added inventory check to controller tests for checkin
Rental tq
Video StoreWhat We're Looking For
|
| @@ -0,0 +1,24 @@ | |||
| class Movie < ApplicationRecord | |||
| validates :title, :inventory, presence: true | |||
| validates :available_inventory, numericality: { greater_than: -1 } | |||
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 is causing the seeds file to fail!
| require "test_helper" | ||
|
|
||
| describe Rental do | ||
| let(:rental) { rentals(:one) } |
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.
No tests here?
Also you should try to see what happens if you create a rental with no available inventory for the movie.
| @@ -0,0 +1,9 @@ | |||
| class Customer < ApplicationRecord | |||
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.
No has_many?
| @@ -0,0 +1,24 @@ | |||
| class Movie < ApplicationRecord | |||
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.
No has many rentals?
| end | ||
| end | ||
|
|
||
| describe "relationships" do |
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.
Missing tests!!!
| end | ||
|
|
||
| describe "custom methods" do | ||
| describe "checkin" do |
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.
What about a customer trying to return a movie that wasn't checked out? Or a movie that wasn't checked out by them?
| render json: movie.as_json(only: [:id]), | ||
| status: :ok | ||
| else | ||
| render json: { errors: ["Movie could not be saved"] }, |
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.
No validation errors reported?
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.