-
Notifications
You must be signed in to change notification settings - Fork 43
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
<pipes><Roxanne Agerone> <MediaRanker> #41
base: master
Are you sure you want to change the base?
Conversation
Media RankerWhat We're Looking For
This is a good start, but it feels like there's still many places with room for improvement. In particular, building routes and views on top of models with complex relations and behaviors seems to have been a challenge. I am noticing that you've added a lot of functionality that isn't in the original site. For example, the advanced routing work around I also had a lot of trouble running your site. It looks like you added a partial implementation of OAuth to your project and then pushed it to GitHub, and the PR picked up your changes (this happens automatically whenever you update a branch). I had to roll back to a previous commit in order to get anything to work. Finally, it seems like you struggled a lot with testing. This is something we'll want to think about moving forward, but for now you should focus on shoring up your core rails understanding. This is a big complex project with many moving pieces, so don't worry if you weren't quite able to get everything working the way you wanted. Still, I feel it would be worthwhile to meet on Monday to talk about how to do better going forward (and because I'm due for a 1-on-1 with you anyway). Please sign up for a slot on my calendar (same link as always). |
config/routes.rb
Outdated
|
||
resources :media_instances do | ||
resources :users, only: [:index] do | ||
resources :votes, only: [ :create, :destroy] |
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.
Why are these routes nested like this? I could see :create
for users/:user/votes
, but other than this these routes should be flat.
</body> | ||
|
||
<footer> | ||
© 2017 |
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 <footer>
should be inside the <body>
|
||
it "returns a success status when given a valid user_id" do | ||
get user_media_instances_path(user.first) | ||
must_respond_with :success |
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 don't understand what the user_media_instances_path
is for, and I don't believe it's used anywhere in your application. This is usually a good indication that the route isn't needed.
end | ||
it "will give an error message for not having media_instance_id nor user_id" do | ||
vote.errors.messages.include? :media_instance_id | ||
vote.errors.messages.include? :user_id |
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.
You don't actually test anything here. Try replacing .include?
with .must_include
.
test/models/media_instance_test.rb
Outdated
media_instance.errors.messages.include? :title | ||
end | ||
it "must reject if there is no media type" do | ||
media_instance.errors.messages.include? :media_type |
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.
Similarly, this doesn't actually check anything. When writing a test, you need to have some expectation (must_something
or wont_something
).
Going through the red-green-refactor cycle would have caught this. You would have tried to watch the test fail, and when it didn't, you would realize something is up.
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
session
andflash
? What is the difference between them?