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

Media Ranker Revisited - Angela - Octos #34

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

Conversation

knockknockhusthere
Copy link

No description provided.

@droberts-sea
Copy link

MediaRanker Revisted

What We're Looking For

Feature Feedback
General
Tests on WorksController yes
Tests on SessionsController yes
Tests on UsersController yes
Completed OAuth yes - logging in the first time had a couple bugs, see inline
Overall Good work overall.

def build_from_github(auth_hash)
return User.new(
name: auth_hash['info']['name'],
email: auth_hash['info']['email'],

Choose a reason for hiding this comment

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

This should be a self method! In your controller you call User.build_from_github, which means logging in as a new user doesn't work.

I'm guessing you made the change after logging in for the first time, so you never hit it in a real workflow. That's why thorough testing is important, it's not always plausible to manually test things.

# provider: auth_hash['provider'])
user = User.build_from_github(auth_hash)
if @user.save
session[:user_id] = @user.id

Choose a reason for hiding this comment

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

Line 18 should be @user =.

# it 'creates a DB entry for a new user' do
# old_user_count = User.count
#
# user = User.new(

Choose a reason for hiding this comment

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

Here is the test that would have caught those two bugs

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