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

Ampers Mary and Zheng #5

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ad9148a
new rails setup
mmlamkin May 7, 2018
fea2e0a
creates models for movie and customer, migrations, seeds db
mmlamkin May 7, 2018
af64e6f
adds validations model test for customer
mmlamkin May 7, 2018
3d13004
adds validation model testing for movie
mmlamkin May 7, 2018
748a5f3
adds movies and customers controllers and routes
mmlamkin May 7, 2018
c4a833c
adds customer index controller test DIDN'T DO MOVIES CHECKOUT COUNT
mmlamkin May 7, 2018
09105d3
modifies movies cont test
mmlamkin May 7, 2018
f0d80b6
adds movie index controller test
mmlamkin May 7, 2018
12450df
adds movie show cont tests
mmlamkin May 7, 2018
3bf2174
adds create controller tests for movie
mmlamkin May 7, 2018
fa38618
changes create to .new plus save
mmlamkin May 7, 2018
a23c7e9
Fix controller test for movie create
2020dream May 7, 2018
8a6b2ca
adds rental join table and model and relationships with customer and …
mmlamkin May 8, 2018
9eec28e
adds relationship model tests for movie
mmlamkin May 8, 2018
1127257
adds relationship test for customer model
mmlamkin May 8, 2018
da2e5b3
adds model tests for rentals
mmlamkin May 8, 2018
881787a
adds routes and controller for rentals
mmlamkin May 8, 2018
6a3d02e
adds checkout controller tests/not actions for rentals
mmlamkin May 8, 2018
d243293
Add RentalsController tests for check_out
2020dream May 8, 2018
01297b6
adds controller tests for rentals-pass tests
mmlamkin May 8, 2018
72d6cb0
Fix Movies#controller show test for 404
2020dream May 8, 2018
f1414ae
Add missing nodes in request body
2020dream May 8, 2018
731e2f3
Comment out validation for phone in Customer
2020dream May 9, 2018
a5cbd85
Add missing fields for customer index and movie show using rabl
2020dream May 9, 2018
e156ab6
Fix customer controller index test by adding missing field
2020dream May 9, 2018
218b506
decreases movie inventory method and test works
mmlamkin May 9, 2018
a54d38d
negative test for availeble inventory in rental controller tests passes
mmlamkin May 9, 2018
26694b7
customer checkout count test in rental model passes
mmlamkin May 9, 2018
2876416
Merge branch 'master' into model-methods
2020dream May 9, 2018
10d6ecf
Pass Wave 3 smoke tests
2020dream May 9, 2018
1324d9e
Refactor model tests
2020dream May 9, 2018
2bc4e90
removes unneeded instance variables in controllers
mmlamkin May 9, 2018
a38ad1e
Refactor controller tests and add more edge cases
2020dream May 9, 2018
766327f
Implement new tests
2020dream May 9, 2018
691d6b0
specifies error messages
mmlamkin May 9, 2018
30ba857
Merge branch 'master' of https://github.com/mmlamkin/VideoStoreAPI
mmlamkin May 9, 2018
909c959
fixes some unknown problem and all tests pass
mmlamkin May 9, 2018
4601486
adds movie model tests for available inventory
mmlamkin May 11, 2018
f8a1041
Implement model method tests
2020dream May 11, 2018
69c9a59
Merge branch 'master' of https://github.com/mmlamkin/VideoStoreAPI
2020dream May 11, 2018
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
adds movie model tests for available inventory
mmlamkin committed May 11, 2018

Verified

This commit was signed with the committer’s verified signature.
frapell Franco Pellegrini
commit 460148677fa486fc583507203391141b04585d94
12 changes: 12 additions & 0 deletions test/models/movie_test.rb
Original file line number Diff line number Diff line change
@@ -49,4 +49,16 @@
movie.rentals.count.must_equal 0
end
end

describe 'available_inventory' do

it 'returns the correct number of available to rent items' do
movies(:two).available_inventory.must_equal 9
end

it 'returns 0 if there are no available movies' do
movies(:one).available_inventory.must_equal 0
end

end
end