Skip to content

Conversation

@nbrandolini
Copy link

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. A method to return a sorted array of works ordered by votes
Describe how you approached testing that model method. What edge cases did you come up with? I have not work on testing but plan to time permitted
What are session and flash? What is the difference between them? 'session' and 'flash' are hashes that are stored that you can access. The difference is that session is available until the browser is closed and flash is only available for the current and next request.
Describe a controller filter you wrote. I wrote a controller filter for find_work and find_user
What was one thing that you gained more clarity on through this assignment? The connection between controllers and running multiple controllers, it gave me a lot of practice at where things are located and what it shows.
What is the Heroku URL of your deployed application? https://nb-mediaranker.herokuapp.com/ Not sure why but seems that not all features are working on Heroku, however they are working on my local host.
Do you have any recommendations on how we could improve this project for the next cohort? For me it was very helpful that we did the books example, however I am not sure if I know what business logic I need to put in the model, so maybe a bit more practice with that and testing for sure.

…utes for votes, added dependent/destroy on models
@CheezItMan
Copy link

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Decent number of commits and good commit messages
Comprehension questions Check,
General
Rails fundamentals (RESTful routing, use of named paths) Check
Semantic HTML Nicely done!
Errors are reported to the user You're missing one on users logging in.
Business logic lives in the models Check, nicely done
Models are thoroughly tested, including relations, validations and any custom logic Testing is good, but not complete, custom methods untested.
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 NOPE
Splash page contains a media spotlight Check
Media pages contain lists of voting users Check
Wave 3 - Styling
Foundation is used appropriately Check, nicely done
Look and feel is similar to the original It looks pretty close! Well done!
Overall This is really good, small problems with incomplete testing, but very good.

has_many :votes, dependent: :destroy
validates :title, presence: true
validates :category, presence: true
validates :category, inclusion: { in: %w(movie book album)}

Choose a reason for hiding this comment

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

👍

if @user
session[:user_id] = @user.id
else
@user = User.create user_name: params[:user][:user_name]

Choose a reason for hiding this comment

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

You should check to verify that create worked! I tried to log in with a blank username and got no error message.

value(user).must_be :valid?
end

it "requires a unique username" 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 test with blank or nil usernames

user2.errors.messages.must_include :user_name
end

describe "total_votes" do

Choose a reason for hiding this comment

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

This makes more sense in the works model

it "must be invalid without a supported category type" do
work.category = "gdfhjgfhjd"
value(work).wont_be :valid?
end

Choose a reason for hiding this comment

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

You also need to test your custom methods bot in the nominal cases and in the case where there are no works or votes.

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