-
Notifications
You must be signed in to change notification settings - Fork 28
Ga-Young and Julia #19
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
added create movie method and tests
Movie validation
Video StoreWhat We're Looking For
|
| @@ -0,0 +1,52 @@ | |||
| class RentalsController < ApplicationController | |||
| def checkout | |||
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.
Nothing to ensure that there are enough movies in the inventory to check it out?
| end | ||
| end | ||
|
|
||
| def checkin |
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.
The check-in/out logic would make sense to put into a model method
| describe Customer do | ||
| # it "does a thing" do | ||
| # value(1+1).must_equal 2 | ||
| # end | ||
| end |
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 "relationships" do | ||
| it "can have many rentals" 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.
You might also add that it could have 0 rentals.
| end | ||
| end | ||
|
|
||
| describe "validations" 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.
No more validations?
| @@ -0,0 +1,19 @@ | |||
| require "test_helper" | |||
|
|
|||
| describe Rental 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.
No test that it's valid with a movie & customer?
| @@ -0,0 +1,28 @@ | |||
| require "test_helper" | |||
|
|
|||
| describe CustomersController 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.
👍
| expect(body.keys).must_include 'id' | ||
| end | ||
|
|
||
| it "responds with bad_request when request fails validation (no customer)" 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 test when the movie isn't available.
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.