Skip to content

Myriam - Ports#37

Open
MyriamWD wants to merge 14 commits intoAda-C11:masterfrom
MyriamWD:master
Open

Myriam - Ports#37
MyriamWD wants to merge 14 commits intoAda-C11:masterfrom
MyriamWD:master

Conversation

@MyriamWD
Copy link
Copy Markdown

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. Work.top -> This model method gets the collection of works that belong to category and organizes the entries from higher to lower. It also stores the first ten works in an array and returns it to the view so the works can be display in Top Media. I used this method on publication year because I haven't gotten to votes yet and I can see it works with a numerical value.
Describe how you approached testing that model method. What edge cases did you come up with? I realized I could check if the collection is empty at the very beginning so I can return empty right away and display a flash message. I can also validate the size of the collection and if the size is less than ten then I could return that collection without going into the loop.
What are session and flash? What is the difference between them? 'flash' lasts the duration of one request cycle. 'session' lasts for as long as the user is logged in or, if applied, expiration of the session (a lot of time without using the page).
What was one thing that you gained more clarity on through this assignment? I have a better understanding of model methods.
What is the Heroku URL of your deployed application? https://mydia-ranker-app.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? I would have liked having the unit 2 assessment a weekend before so I could have invested more time on Media Ranker.

@CheezItMan
Copy link
Copy Markdown

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene
Comprehension questions
General
Rails fundamentals (RESTful routing, use of named paths) For the most part, you forgot a path once in a link_to
Views are well-organized (DRY, use of semantic HTML, use of partials) Check
Errors are reported to the user No because of no validations working, but it does redirect with flash notice when invalid work ids are used
Business logic lives in the models You have a start here
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 MISSING
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 MISSING
The ID of the current user is stored in the session MISSING
A user cannot vote for the same media more than once MISSING
All media lists are ordered by vote count MISSING
Splash page contains a media spotlight Yes, by publication year
Wave 3 - Users and Votes
Media pages contain lists of voting users fake users yes, with no votes
Individual user pages and the user list are present MISSING
Optional - Styling
Bootstrap is used appropriately Decent styling start
Look and feel is similar to the original Pretty close
Overall It seems like you got most of the styling done, but the business logic and testing isn't there. This isn't good. For the bEtsy project I'd like you to put in time working with both business logic and writing tests for it. Perhaps taking a backseat on styling to focus on core Rails skills which include model logic, and testing.

Comment thread test/models/work_test.rb
let(:work) { Work.new }

it "must be valid" do
value(work).must_be :valid?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not passing due to validations.

end

def update
@work = Work.find_by(id: params[:id])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What if you can't find the work?

require "test_helper"

describe WorksController do
# it "must be a real test" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing tests

require "test_helper"

describe UsersController do
# it "must be a real test" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing tests

Comment thread app/models/work.rb
end

def self.top(category)
full_collection = Work.where(category: category).order("lower(publication_year) DESC")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good that you are using the DB to sort things, odd that you're sorting by publication year.

</head>
<header class="app-header__header">
<h1>
<%= link_to "Media Ranker"%>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No route to link to?

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<header class="app-header__header">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Where is the body tag?

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