Skip to content
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

Ann and Regan's Fine Fine Video Store API #3

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0433510
Initial setup
pancake-batfish May 9, 2017
541278f
Generate customer, movie and rental models
pancake-batfish May 9, 2017
f28cc23
Add sketched-out routes to routes file
pancake-batfish May 9, 2017
25f84c6
added customer yml fixtures
gofarann May 9, 2017
4e9d845
Stub in tests for movie model
pancake-batfish May 9, 2017
253a37f
added tests to customer model
gofarann May 9, 2017
6ff5942
First movie validations tests
pancake-batfish May 9, 2017
2c6ea17
Add presence validations for title and inventory
pancake-batfish May 9, 2017
3f7ea24
customer model test
gofarann May 9, 2017
73f1289
Add tests and validations for uniqueness
pancake-batfish May 9, 2017
b485b74
Add inventory tests and validations for movie
pancake-batfish May 9, 2017
a4b7449
Add test for relation of movie to rental
pancake-batfish May 9, 2017
e9fd684
all model test validations passed thus far
gofarann May 9, 2017
bc3edac
merge conflicts
gofarann May 9, 2017
e7482be
Stub in rental model tests
pancake-batfish May 9, 2017
21d1345
Merge branch 'rental_tests'
pancake-batfish May 9, 2017
8c3bfc2
Add test to require associated movie for rental
pancake-batfish May 9, 2017
7daf8f7
Add chronic gem and defaults for rental model
pancake-batfish May 9, 2017
e9ef964
added rental model tests
gofarann May 9, 2017
4432ab3
merge deconflicted
gofarann May 9, 2017
95c9159
Generate rentals and customers controllers
pancake-batfish May 9, 2017
c79bf6c
Uncomment first routes
pancake-batfish May 9, 2017
f23cd92
added movie index controller method and tests
gofarann May 9, 2017
5244c59
Add tests and controller action for customer index
pancake-batfish May 10, 2017
2641f41
Add custom method to customers and return value in json for customer …
pancake-batfish May 10, 2017
55f2513
Merge branch 'customer_index'
pancake-batfish May 10, 2017
0df9bad
Rename constant in tests to avoid conflict
pancake-batfish May 10, 2017
cc59455
added test stubs for checkout method
gofarann May 10, 2017
eab2a5e
First test movie show
pancake-batfish May 10, 2017
4a16b11
Additional tests and action for movie show
pancake-batfish May 10, 2017
a8c2d9c
Add negative test for movie show
pancake-batfish May 10, 2017
94d9e28
Complete movie show tests
pancake-batfish May 10, 2017
a8d152b
Stub in tests for checkin
pancake-batfish May 10, 2017
184273b
First rental update test
pancake-batfish May 10, 2017
bc286bb
rental controller tests
gofarann May 10, 2017
ad93c60
Start to build out update method
pancake-batfish May 10, 2017
6342b68
more checkout tests
gofarann May 10, 2017
9589853
Add tests and logic for invalid customer id or movie title
pancake-batfish May 11, 2017
579c021
Complete checkin tests
pancake-batfish May 11, 2017
208b099
Add seed for rental
pancake-batfish May 11, 2017
2a4149a
more rental checkout contorller testing
gofarann May 11, 2017
88234c8
Merge pull request #1 from pancake-batfish/checkin
gofarann May 11, 2017
5b04d87
Merge branch 'master' into rental_post_checkout
pancake-batfish May 11, 2017
ffe2e2d
Merge pull request #2 from pancake-batfish/rental_post_checkout
pancake-batfish May 11, 2017
670d719
added decrease inventory logic
gofarann May 11, 2017
38c070c
Stub in tests for customers sort
pancake-batfish May 11, 2017
779f024
WIP sort tests
pancake-batfish May 11, 2017
24c9aae
Add movies checked out count method
pancake-batfish May 12, 2017
be2894f
added overdue controller tests
gofarann May 12, 2017
4105087
Add test and logic to increase movie inventory on checkin
pancake-batfish May 12, 2017
3268737
Revise tests and methods to use available_inventory rather than inven…
pancake-batfish May 12, 2017
6be0e6a
Merge branch 'optional_parameters'
pancake-batfish May 12, 2017
e8fb922
making changes in overdue method
gofarann May 12, 2017
6aea9c7
resolved overdue method errors
gofarann May 12, 2017
d9f0a4a
resolved merge conflicts
gofarann May 12, 2017
05d9189
Merge branch 'master' of https://github.com/pancake-batfish/VideoStor…
pancake-batfish May 12, 2017
b625ff9
Tests and action to accept sort parameter for customer index
pancake-batfish May 12, 2017
ee99fa7
fixed display for overdue
gofarann May 12, 2017
53d58d6
took out due date in past test
gofarann May 12, 2017
675237d
Merge branch 'master' of https://github.com/pancake-batfish/VideoStor…
pancake-batfish May 12, 2017
eeab146
Merge branch 'sort_customers'
pancake-batfish May 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Complete checkin tests
pancake-batfish committed May 11, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 579c02136015d1347533445ceb3097afcbdd395f
12 changes: 8 additions & 4 deletions test/controllers/rentals_controller_test.rb
Original file line number Diff line number Diff line change
@@ -30,13 +30,19 @@
end

it "renders bad request for invalid customer id data" do
#customer id not found
post checkin_path(movie.title), params: { customer_id: (Customer.last.id + 1)}
must_respond_with :bad_request
body = JSON.parse(response.body)
body["error"].must_include "customer"
end

it "renders bad request if movie not found" do
post checkin_path("totally made up title"), params: { customer_id: customer.id }
must_respond_with :bad_request
body = JSON.parse(response.body)
body["error"].must_include "movie"
end

it "renders a different message if rental does not exist" do
#rental does not exist (customer does not actually have that movie checked out)
post checkin_path(movie.title), params: { customer_id: customer2.id}
@@ -45,8 +51,6 @@
body["error"].must_include "not checked out"
end

it "returns status not found if movie not found" do skip
#movie title does not return movie
end

end
end