Skip to content

Conversation

@brandyaustinseattle
Copy link

@brandyaustinseattle brandyaustinseattle commented Apr 14, 2018

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I wrote a model method that found the top 10 movies using .sort_by, .reverse, and .first(10).
Describe how you approached testing that model method. What edge cases did you come up with? I couldn't really figure out how to test the model like we did in class after re-reading the lectures and asking for help. I wrote some tests though and they pass. Tried to create an edge case for when there's a tie for media spotlight.
What are session and flash? What is the difference between them? Session and flash are cookies. Session tracks a user while they are logged in and records when the user logs in/logs out. Flash holds information for one browser request that can be displayed on the screen.
Describe a controller filter you wrote. I wrote a controller filter to find the current user in the application controller. This is needed to display the information in the header that says who's logged in.
What was one thing that you gained more clarity on through this assignment? I gained more clarity on the basics of setting up a rails project and putting logic in the model when possible.
What is the Heroku URL of your deployed application? https://austin-media-ranker.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? It would have been nice to go over how the in-class examples of model testing relate to how we were supposed to test in MediaRanker. I have no idea if my tests are appropriate, but they don't look similar to the in-class examples which is probably less than ideal.

@CheezItMan
Copy link

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good commit messages, reasonable number of commits
Comprehension questions Check, we will spend some more time on testing before we finish Rails.
General
Rails fundamentals (RESTful routing, use of named paths) Check
Semantic HTML You have your header tag outside the body element.
Errors are reported to the user Check
Business logic lives in the models Good top_ten method, they could be dryed up slightly
Models are thoroughly tested, including relations, validations and any custom logic Pretty good overall, some edge-cases not tested, but you covered most cases.
Wave 1 - Media
Splash page shows the three media categories Check
Basic CRUD operations on media are present and functional Check
Wave 2 - Users and Votes
Users can log in and log out Check
The ID of the current user is stored in the session Check
Individual user pages and the user list are present Check
A user cannot vote for the same media more than once Check
All media lists are ordered by vote count The all works page is not sorted by vote count.
Splash page contains a media spotlight Check
Media pages contain lists of voting users Check
Wave 3 - Styling
Foundation is used appropriately Well done
Look and feel is similar to the original Looks Good!
Overall Nicely done, I read that you struggled with testing, but I think you covered the essentials. I like the custom methods in the work.rb file and your filters. You definitely hit all the learning goals for this project, nice work! In future projects pay a bit of attention to valid HTML in your layout file and look for more edge cases in your testing.


validates :category, presence: { message: "You must choose a category" }

validates :title, presence: { message: "Title can't be blank" }

Choose a reason for hiding this comment

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

What about validations for publication year?

end

def self.top_movies
where(category: "movie").sort_by{ |m| m.votes.count }.reverse.first(10)

Choose a reason for hiding this comment

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

These methods could be DRYed up slightly by creating a generic method with a parameter.

<%= csrf_meta_tags %>
</head>

<header class="page-header">

Choose a reason for hiding this comment

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

You've put this element outside the body. That's not valid HTML.

@all_movies = Work.all_movies
end

it 'returns all movies' do

Choose a reason for hiding this comment

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

You should also test the result when there are no movies.


describe 'media spotlight' do

it 'returns top work' do

Choose a reason for hiding this comment

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

What about when there are either no votes or no works?


end

describe 'top moves, books, albums' do

Choose a reason for hiding this comment

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

You also need to see what happens when there are more than 10 works in a category and when there are no works in a category.

validates :title, presence: { message: "Title can't be blank" }

def self.all_movies
where(category: "movie")

Choose a reason for hiding this comment

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

You should include something to order the content as well.

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