forked from AdaGold/video-store-api
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Queues - Andrea Valliere & Kaitlin Ramirez - VideoStoreAPI #9
Open
avalliere
wants to merge
18
commits into
Ada-C7:master
Choose a base branch
from
avalliere:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,280
−0
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
68b6702
Initial commit. Generated movie model
avalliere e16f1b5
Generated customer and rental models
avalliere a0302c0
Generated controllers for customers and movies
avalliere b81eb0e
Added first test to movies model test
avalliere b3c0b90
Wrote tests for movies index. All pass
avalliere 4345a98
Tests added for show method for Movies Controller. All passing
avalliere 31f08eb
Added initial tests for customers controller index method
avalliere 2e86364
Created tests for show method for customers controller
avalliere 06d38e7
first model validation test for customer
a0bdc95
Added model tests for Movie. Added validation to Movie model
avalliere ca8a4fa
movie tests
a7dc812
Merge branch 'master' of https://github.com/avalliere/VideoStoreAPI
1a0de30
Added serializer for customer and movie
avalliere 80dee3d
Added movies_checked_out_count method to customer serializer. Custome…
avalliere 52fb3f0
Merge branch 'master' of https://github.com/avalliere/VideoStoreAPI
avalliere 9c2a15c
Refactored routes, movies model, movies serializer to pass all smoke …
avalliere c7f07d7
error handling
59fbe6d
fixed tests, smoke test passes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
first model validation test for customer
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
class Customer < ApplicationRecord | ||
has_many :rentals | ||
has_many :movies, :through => :rentals | ||
validates :name, presence: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
Rails.application.routes.draw do | ||
get "customers", to: "customers#index", as: "customers" | ||
get "movies", to: "movies#index", as: "movies" | ||
|
||
get "movie/:id", to: "movies#show", as: "movie" | ||
|
||
get "customers", to: "customers#index", as: "customers" | ||
|
||
get "customer/:id", to: "customers#show", as: "customer" | ||
# get "customer/:id", to: "customers#show", as: "customer" | ||
|
||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,16 +28,16 @@ | |
end | ||
end | ||
|
||
describe "show" do | ||
it "can get a customer" do | ||
get customer_path(customers(:two).id) | ||
must_respond_with :success | ||
end | ||
|
||
it "does not get a customer that does not exist" do | ||
get customer_path(Customer.last.id+1) | ||
must_respond_with :not_found | ||
end | ||
end | ||
# describe "show" do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you don't need this just delete |
||
# it "can get a customer" do | ||
# get customer_path(customers(:two).id) | ||
# must_respond_with :success | ||
# end | ||
# | ||
# it "does not get a customer that does not exist" do | ||
# get customer_path(Customer.last.id+1) | ||
# must_respond_with :not_found | ||
# end | ||
# end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
delete any code you're not using