-
Notifications
You must be signed in to change notification settings - Fork 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
Ampers: Mariko, Kate, and Katie #10
base: master
Are you sure you want to change the base?
Conversation
Feature model test
… and customers controllers with appropriate actions
…l do testing next
merge with movie controller actions
…r empty array if there are no existing customers
…entory, and altered seed.rb to set the value equal to json inventory values
…ion and updated test for new field
…ntroller creates tests for the create method in the movies controller
changes code to get smoke tests working
…e tests and added more details to the negative tests
creates test for movie relationships to rentals
adds tests for rental model validation tests and relationship tests
relationship testing customer has many rentals
… the controller and use strong params, and fixed movie controller tests to respect foreign key violation
…nteresting' changes to occur on the available_inventory of movies and the movies_checkout_count for a customer
…nnot exceed the inventory for a movie
… edited yml files
Video StoreWhat We're Looking For
|
if customer && movie | ||
if movie.available_inventory > 0 | ||
rental = Rental.new(customer: customer, movie: movie, checkout_date: Date.today, due_date: Date.today + 7.days) | ||
customer.movies_checked_out_count += 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 kind of business logic really doesn't go here.
rental = Rental.find_by(customer: customer, movie: movie, returned: false) | ||
if rental | ||
rental.returned = true | ||
customer.movies_checked_out_count -= 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.
ditto on business logic
|
||
it "can have no rentals" do | ||
customer = customers(:shell) | ||
customer.rentals.length.must_equal 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.
Why are you testing for a rental length of 1, if there are no rentals?
body.must_include "id" | ||
|
||
# Check that the ID matches | ||
Movie.find(body["id"]).title.must_equal "The Princess Bride" |
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 movie 👍
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