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

Pipes - Rebecca - MediaRanker #21

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Conversation

rbergena
Copy link

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I wrote a custom method in the work model to get the top ten media in a category.
Describe how you approached testing that model method. What edge cases did you come up with? I tested the case where the category has less than 10 items.
Describe an edge case test you wrote for a controller In the works controller I tested a case for the upvote action where a loged in user tries to vote on the same work twice.
What are session and flash? What is the difference between them? Flash displays a single time while session persists
Describe a controller filter you wrote. I used a controller filter for finding a work by params id.
What was one thing that you gained more clarity on through this assignment? Using dependent destroy and testing dependent destroy.
What is the Heroku URL of your deployed application https://reber-mediaranker.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort?

@droberts-sea
Copy link

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene yes
Comprehension questions yes
General
Rails fundamentals (RESTful routing, use of named paths) yes
Semantic HTML yes
Errors are reported to the user yes
Business logic lives in the models yes
Models are thoroughly tested, including relations, validations and any custom logic yes
Controllers are thoroughly tested yes - good work testing upvote
Wave 1 - Media
Splash page shows the three media categories yes
Basic CRUD operations on media are present and functional yes
Wave 2 - Users and Votes
Users can log in and log out yes
The ID of the current user is stored in the session yes
Individual user pages and the user list are present yes
A user cannot vote for the same media more than once yes
All media lists are ordered by vote count yes
Splash page contains a media spotlight yes
Media pages contain lists of voting users yes
Wave 3 - Styling
Foundation is used appropriately yes
Look and feel is similar to the original yes - great work
Overall Great work overall!

private

def self.sort
Work.all.sort_by {|work| -work.votes.count}

Choose a reason for hiding this comment

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

Good use of a private helper method here.

@@ -0,0 +1,86 @@
class WorksController < ApplicationController
before_action :find_work_by_params_id, only: [:show, :edit, :update, :destroy]

Choose a reason for hiding this comment

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

Good use of filters to DRY up this controller

user1:
username: username1
date_joined: 2017-10-11

Choose a reason for hiding this comment

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

Pro tip: you can use erb inside a fixtures file. This could be shortened to something like

<% 20.times do |i| %>
user_<%= i %>:
  username: username_<%= i %>
  date_joined: 2017-10-<%= i %>
<% end %>

it "returns an empty array if category has no works" do
top_albums = Work.top_ten("movie")
top_albums.must_be :empty?
end

Choose a reason for hiding this comment

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

I love these three test cases! Good work!

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