Skip to content

Conversation

@MiraMarshall
Copy link

@MiraMarshall MiraMarshall commented Apr 29, 2019

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I wrote a custom method to display the top ten works.
Describe how you approached testing that model method. What edge cases did you come up with? What would happen if there weren't 10 works to pick from? Made sure it would display all available if less than 10.
What are session and flash? What is the difference between them? Session is used to keep track of a user logged into the app. Additionally, a session uses cookies to track a session through many request/response cycles, while the user is logged in. Flash is used when we want to display a message to a user and doesn't keep track of whether or not a user is logged in.
What was one thing that you gained more clarity on through this assignment? Better understanding with login and logout sessions.
What is the Heroku URL of your deployed application? https://mira-mediaranker.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? Timing. It would have been helpful to not have this project at the same time as the Unit 2 Assessment. Other than that, I really enjoyed working on this project.

@CheezItMan
Copy link

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene More commits would have been better, good commit messages
Comprehension questions Check
General
Rails fundamentals (RESTful routing, use of named paths) You created all the CRUD routes for user, but users have limited routes.
Views are well-organized (DRY, use of semantic HTML, use of partials) Unfinished, but what you have is ok.
Errors are reported to the user NOPE
Business logic lives in the models Limited business logic
Models are thoroughly tested, including relations, validations and any custom logic Almost no testing
Controllers are thoroughly tested, including the login/logout process and multi-step workflows like voting for a work Limited testing
Wave 1 - Media
Splash page shows the three media categories Check
Basic CRUD operations on media are present and functional Delete doesn't work, add can create invalid works, Edit doesn't work
Wave 2 - Users and Votes
Users can log in and log out Yes, but view all users views all the works
The ID of the current user is stored in the session Can't vote
A user cannot vote for the same media more than once Can't vote at all
All media lists are ordered by vote count NOPE
Splash page contains a media spotlight NOPE Entry is there, but it's empty
Wave 3 - Users and Votes
Media pages contain lists of voting users NOPE contains works instead
Individual user pages and the user list are present NOPE
Optional - Styling
Bootstrap is used appropriately Some bootstrap styling working
Look and feel is similar to the original Somewhat
Overall You obviously didn't get finished here, I'd like you to try to put in some time into MediaRanker OAuth. I'd like to see good testing with controllers and models. Let me know if you have any questions on my comments.

fixtures :all
# Add more helper methods to be used by all tests here...

# def perform_login(user = nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why comment this out?

describe User do
let(:user) { User.new }

it "must be valid" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other tests for user?

describe Vote do
let(:vote) { Vote.new }

it "must be valid" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other tests for vote? What about a validation to ensure that the combination work_id and user_id is unique.

end
end

describe "validations" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other validations/

end

describe "topten" do
it "will return top votes" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about spotlight?

redirect_to root_path
end

def upvote

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is rather long, and nonfunctional on the site, but I suggest adding a method to the Usermodel for upvoting. That can help you reduce the size of your controller method here.

@work = Work.find_by(id: params[:id])

if !@work
head :not_found

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest redirecting instead of head at this point.


has_many :votes
has_many :users, through: :votes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest a spotlight method as well.

Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root to: "homepage#index"
resources :works, :users

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have all the restful routes as a user?


<%= f.submit action_name, class:"work-form-btn"%>

<% end%> No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants