-
Notifications
You must be signed in to change notification settings - Fork 25
Alice and Hannah - VideoStoreAPI #6
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
…dex, added rabl gem and added forgery protection to controllers
…gery check in order for postman to work
…ts for overdue items and available_inventory
…method names checkin checkout
Video StoreWhat We're Looking For
|
| movie = movies(:movieone) | ||
| starting_inventory = movie.available_inventory | ||
|
|
||
| expect { |
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 test is failing because this customer has overdue items and so is forbidden from checking out a movie.
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.
Fixed! The Date.tomorrow for customer one in the yml file fixed everything.
| end | ||
|
|
||
| it "returns false if customer has no overdue items" do | ||
| expect(customer.overdue_items?).must_equal false |
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 test is failing, because this customer has an item which was due yesterday. If you want to fix this, I would use erb tags to set the due date to Date.tomorrow, so it would never be overdue.
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.
Ah! Totally forgot about these dates. Fixed!
|
|
||
| body = JSON.parse(response.body) | ||
| expect(body).must_be_kind_of Array | ||
| expect(body.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.
This test is failing, because this customer has two overdue movies.
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.
Fixed!
| @customers = sort_and_paginate(sort_options, list, params) | ||
| end | ||
|
|
||
| def zomg |
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.
😀
| @@ -0,0 +1,92 @@ | |||
| class ApplicationController < ActionController::API | |||
|
|
|||
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.
I like the helper methods you put in here.
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.