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

Sam & Hannah -- Octos #17

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
786aa86
create new rails api app
samanthaberk May 7, 2018
f3beb43
create customers controller
samanthaberk May 7, 2018
1886154
Create customer model
samanthaberk May 7, 2018
2e52676
Add relations to customer class
samanthaberk May 7, 2018
3421d2d
added in movies controller and model
hannahlcameron May 7, 2018
d659e74
resolved merge cnflict in schema
hannahlcameron May 7, 2018
d9e2415
added rental model and foreign key relations
hannahlcameron May 7, 2018
625a9a5
added rentals controller, added relations to rentals
hannahlcameron May 7, 2018
45fcc91
Add /zomg route and confirm it works
samanthaberk May 7, 2018
cbc6002
added model validations to customer and movie
hannahlcameron May 7, 2018
41168b6
added and passing customer validation tests
hannahlcameron May 7, 2018
77e01eb
Build tests for validations on movie model
samanthaberk May 7, 2018
f0987f0
write some tests
samanthaberk May 8, 2018
22c1bf7
wrote relations tests
hannahlcameron May 8, 2018
9f94646
resolved merge conflict in yml files
hannahlcameron May 8, 2018
0f98b40
revised relations tests, passing
hannahlcameron May 8, 2018
aed9342
added in negative test cases for relations
hannahlcameron May 8, 2018
0862448
add test for if the movie has not been renter
samanthaberk May 8, 2018
b5e7826
Merge branch 'movies-tests'
samanthaberk May 8, 2018
eac8b4b
wrote relations tests for rentals model
hannahlcameron May 8, 2018
4470c5e
wrote customer#index controller tests - added in route and filled in …
hannahlcameron May 8, 2018
6f69770
added in test for if no customers
hannahlcameron May 8, 2018
56339d6
Merge branch 'get_customers'
hannahlcameron May 8, 2018
bd9dc0a
Add controller tests to movies#index
samanthaberk May 8, 2018
826af96
Add before block so not repeating code
samanthaberk May 8, 2018
7dabaeb
added migrations/updated movie.rb to account for setting avialable in…
hannahlcameron May 8, 2018
eeefb89
added in negative test cases for rental.rb
hannahlcameron May 8, 2018
b5ca545
change order for sort on movies controller test
samanthaberk May 8, 2018
53b18ab
revised what customers#index removes
hannahlcameron May 8, 2018
4b66bbe
All tests passing
samanthaberk May 8, 2018
63cc4c3
Remove Zomg and condense routes
samanthaberk May 8, 2018
0b66246
Merge branch 'master' of https://github.com/samanthaberk/VideoStoreAPI
hannahlcameron May 8, 2018
8eebda3
Write initial tests for movie#show
samanthaberk May 8, 2018
5ae0389
movies#show working with passing tests
samanthaberk May 8, 2018
a30a031
Merge branch 'master' of https://github.com/samanthaberk/VideoStoreAPI
hannahlcameron May 8, 2018
ff12a1b
added in movies#create tests
hannahlcameron May 8, 2018
019c22b
added route and method for movies#create - passing all controller tests
hannahlcameron May 8, 2018
63d446f
change status for successful movies post from :created to :success to…
hannahlcameron May 8, 2018
8098059
Add checkout date and due date with default values to Rentals table
samanthaberk May 8, 2018
0af344a
Merge branch 'master' of https://github.com/samanthaberk/VideoStoreAPI
samanthaberk May 8, 2018
5148b7f
Write initial controller tests for rentals#checkout
samanthaberk May 8, 2018
6f78be5
Write routes for checkout and checkin and code for checkout that pass…
samanthaberk May 9, 2018
244e3ca
Change checkout and checkin routes to match smoke test requirements
samanthaberk May 9, 2018
1c6de97
added in decrement_available_inventory tests; modified the before val…
hannahlcameron May 9, 2018
494b63c
wrote decrement_avail_inv, passing all tests
hannahlcameron May 9, 2018
15408d2
revised rental#create to accomodate for avail_inv; wrote find_rental_…
hannahlcameron May 9, 2018
25264f8
revised rental#create, passing all controller tests; moved helper met…
hannahlcameron May 9, 2018
19dfd05
Write tests for increment_available_inventory on Movie class and code…
samanthaberk May 9, 2018
bd13df2
Write intital controller tests for checkin
samanthaberk May 9, 2018
d6ba637
write rentals#create tests and code that passes those tests
samanthaberk May 11, 2018
d2a3620
added customer model increment and decrement movies checked out count…
hannahlcameron May 11, 2018
bbfec9f
fixed failing tests
hannahlcameron May 11, 2018
8670626
removed 2x private methods for finding movie and customer
hannahlcameron May 11, 2018
06c4359
passing all smoke tests - added in customer.save and movie.save
hannahlcameron 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
fixed failing tests
  • Loading branch information
hannahlcameron committed May 11, 2018
commit bbfec9faf5634532d3ed9dead4166a78ddf74f2e
2 changes: 1 addition & 1 deletion app/models/customer.rb
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ def decrement_movies_checked_out_count
end

def increment_movies_checked_out_count
self.available_inventory += 1
self.movies_checked_out_count += 1
end

end
3 changes: 3 additions & 0 deletions test/models/customer_test.rb
Original file line number Diff line number Diff line change
@@ -68,6 +68,9 @@
end

it "reduces movies checkout out count for specific customer by 1" do
@customer.movies_checked_out_count = 1
@customer.save

before_movies_count = @customer.movies_checked_out_count

@customer.decrement_movies_checked_out_count