Skip to content

Laura Robertson -- Carets#27

Open
LauraAddams wants to merge 63 commits intoAda-C8:masterfrom
LauraAddams:master
Open

Laura Robertson -- Carets#27
LauraAddams wants to merge 63 commits intoAda-C8:masterfrom
LauraAddams:master

Conversation

@LauraAddams
Copy link

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I created a method for sorting by popularity of works, it counts the number of votes for each work by category and sorts them in order of most votes to least.
Describe how you approached testing that model method. What edge cases did you come up with? I tested the sorting by checking its result type, category, and first title. Before the tests a created one vote. I realize there isn't really a proper edge case test.
Describe an edge case test you wrote for a controller Testing if a user is created when given and empty string.
What are session and flash? What is the difference between them? Session is a cookie based hash. In this case a user is logged in until they close the browser. Flash are messages to the user based on actions.
Describe a controller filter you wrote. I don't think I actually got to the controller filters.
What was one thing that you gained more clarity on through this assignment? A general better understanding of rails: where files are, work flow, and method locations.
What is the Heroku URL of your deployed application https://intense-meadow-96559.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? While the overall project is actually quite simple, it takes a lot of time to think about how to make votes, sessions, etc work which made me lose time to focus on testing.

@tildeee
Copy link

tildeee commented Oct 17, 2017

Media Ranker

What We're Looking For

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

@tildeee
Copy link

tildeee commented Oct 17, 2017

You killed it with this project!

Good job catching some of the edge cases, like trying to log in with an empty string username. (Not a lot of people caught this :) )

The look of the site looks so spot on, too! Great job.

You found a way to display error messages anyway, but we expected those to be passed into flash messages (which you also set!)
I've made a little comment on it.

flash[:success] = "Item successfully added"
redirect_to root_path
else
flash.now[:success] = "Item could not be added"
Copy link

Choose a reason for hiding this comment

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

maybe instead of adding this message to [:success], you could do a line something like this in the controller

flash[:error] = @work.errors.messages

and in your view (probably application.html.erb) the following code:

<% work.errors.messages.each do |name, errors| %>
  <% errors.each do |message| %>
    error name: <% name %>
    error message: <% message %>
  <% end %>
<% end %>

Of course this is just some inspiration code, you can form it to what you need it to be :)

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