-
Notifications
You must be signed in to change notification settings - Fork 24
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
Isabel & Lauren -- Carets #17
base: master
Are you sure you want to change the base?
Conversation
…se and migrate. Add ERD and simplecov gems.
… column in Customers table. Seed database.
…lder to gitignore.
…ller. All tests passing.
…oller. All tests passing
…to movie and customer models.
…tests passing. Wave 2 complete.
… to movie model. All tests passing, 82% coverage in rentals controller.
…ues w params in Movies controller
…y. All tests passing.
Video StoreWhat We're Looking For
|
validates :inventory, numericality: {only_integer: true, greater_than: 0 } | ||
|
||
def available_inventory | ||
unavailable = Rental.where(movie_id: self.id, returned: false).count |
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.
Good that you're using .where
to find the rentals, the Database is faster.
end | ||
|
||
it "returns customers with the required fields" do | ||
keys = %w(id movies_checked_out_count name phone postal_code registered_at) |
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.
nicely written
it "returns not found if movie id is invalid" do | ||
dune.destroy | ||
get movie_path(dune.id) | ||
must_respond_with :not_found |
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 the fields in the JSON returned?
|
||
body = JSON.parse(response.body) | ||
body.must_be_kind_of Hash | ||
body.must_include "errors" |
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.
Good
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