-
Notifications
You must be signed in to change notification settings - Fork 51
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
Branches-Amal #45
base: master
Are you sure you want to change the base?
Branches-Amal #45
Conversation
…d work index action and view
Media RankerWhat We're Looking ForManual Testing
Targeted Code Review
Targed Test Review
Overall FeedbackYou are soooo close to having a fully functional Media Ranker project. I've left notes for you to find where there are bugs in the application and how to fix'em. You also have some decent testing here, although you don't cover all the edge-cases. It looks like you ran out of time. |
@movies = Work.by_category("movie") | ||
@books = Work.by_category("book") | ||
@albums = Work.by_category("album") |
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 do not have a class method .by_category
in work.rb
flash[:success] = "Successfully logged in as returning user #{username}" | ||
else | ||
@user = User.new(username: username) | ||
session[:user_id] = @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 are setting the session to return_user.id
before you save the user, so the user model doesn't have an I yet!
<ul class="nav app-header__user-nav-container"> | ||
<%if session[:user_id]%> | ||
<li class="nav-item app-header__nav_item"> | ||
<%=link_to "logged in as #{User.find_by(id: session[:user_id]).username}", user_path(id: session[:user_id]), class: "btn btn-primary"%> |
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 find_by
functionality should instead be in a controller filter.
votes= [votes(:nouservote)] | ||
bob = users(:bob) | ||
|
||
bob.votes = votes |
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.
Normally you would simply do
bob.votes << votes(:nouservote)
@album = works(:album) | ||
end | ||
it "is vaild when all fields are present" do | ||
assert(@album.valid?) |
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 is really assert-style testing. It works, but it's not the style we're using in class.
assert(@album.valid?) | |
expect(@album.valid?).must_equal true |
assert(@album.valid?) | ||
end | ||
|
||
it "is invalid if title is blank" do |
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.
Only one validation?
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
session
andflash
? What is the difference between them?