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

Nkiru - Pipes- MediaRanker #30

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

Nkiru - Pipes- MediaRanker #30

wants to merge 74 commits into from

Conversation

nkiruka
Copy link

@nkiruka nkiruka commented Oct 16, 2017

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. A wrote a self method to find the top media, so the method can be called without needing an instance of work. The method checks all the works and finds the media with the highest volts by using the enumerable method max_by
Describe how you approached testing that model method. What edge cases did you come up with? Did not complete this task: Wanted to test what would happen if there was a tie for the highest votes; my thought was to select the first work. I also would have tested if there were no votes cast by a user. I would have like to test what would have happened if a creator deleted the work with the highest votes, if it will return true that that work no longer has the max votes. Soft passing case: Test that to make sure the method accurately finds the max of work with the highest votes.
Describe an edge case test you wrote for a controller A bad request is returned if an update is unsuccessful if a work id is invalid. Test is effective because is checks that the work count before an update is requested is the same as the work count after the unsuccessful update.
What are session and flash? What is the difference between them? Flash is a special hash that is used to send one time message to controllers and views. Common usage of flash is to denote success or failure of events. session lasts until the user's session is over (i.e when user has closed the browser). Session is similar to hash except that data stored there will not go away after the next request-response cycle.
Describe a controller filter you wrote. Did not get to use one, focused on functionality of the program.
What was one thing that you gained more clarity on through this assignment? Model relationships, but still looking forward to more practice
What is the Heroku URL of your deployed application https://mediajunkiebuff.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? More project time in class especially if project is assigned over 4 day week.

@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 - some extra routes
Semantic HTML mostly - see inline comments
Errors are reported to the user mostly - the only place I noticed this missing is when upvoting a work fails
Business logic lives in the models yes - great work!
Models are thoroughly tested, including relations, validations and any custom logic some - Missing tests for custom logic. Interesting cases for the top_ten_x methods include: what if there are no models with that category? What if there are more than 10?
Controllers are thoroughly tested mostly - a couple missing, but in general this looks good
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 no
Wave 3 - Styling
Foundation is used appropriately some - seems like there is a lot to explore here still
Look and feel is similar to the original some
Overall Great job overall! I've left a few inline comments to review, and I want to make sure you take some time to experiment with Foundation on bEtsy, but in general I am quite happy with this submission. Keep up the hard work!


resources :votes

resources :users

Choose a reason for hiding this comment

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

I'm not sure you need all seven RESTful routes for votes and users. Be careful when using resources to only generate the routes you plan to use.


<table>
<h3> Albums </h3>
<thead>

Choose a reason for hiding this comment

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

Is there a way you could use a view partial to DRY up repeated HTML on this page?

Choose a reason for hiding this comment

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

Also, I would like to see each category in its own <section> here.

def show
find_work_by_params_id
# @work = Work.find_by(id: params[:id])
# unless @work

Choose a reason for hiding this comment

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

You are basically using find_work_by_params_id as a controller filter already here - the last step is to take advantage of Rails's syntactic sugar to clean up the code a bit.

def self.top_ten_albums
album = Work.where(category: "album")
return album.sort_by { |work| -work.votes.count }.take(10)
end

Choose a reason for hiding this comment

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

Watch your indentation here

describe UsersController do
# it "must be a real test" do
# flunk "Need real tests"
# end

Choose a reason for hiding this comment

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

Even though we didn't ask you to test login/logout, you should at least have tests for index and show here.


#question should be what will cause the index page not to show. since it is ordered by title then if title isn't present maybe it wont show?? I wonder if I could mess with the form and that could result in html not rendering properly. perhaps!

#not sure what to do with this yet, need an invalid case. do I need to check work id

Choose a reason for hiding this comment

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

This is a good question! Could be there is no failure case here, which would mean all the tests for this action result in success.


must_respond_with :not_found
Work.count.must_equal start_work_count
end

Choose a reason for hiding this comment

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

What if you try to destroy a work with votes? Can you do it? What happens to the votes?

These are exactly the sorts of questions that the end-to-end style of a controller test is suitable to answer.

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