-
Notifications
You must be signed in to change notification settings - Fork 45
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
base: master
Are you sure you want to change the base?
Conversation
MediaRanker RevistedWhat We're Looking For
|
def build_from_github(auth_hash) | ||
return User.new( | ||
name: auth_hash['info']['name'], | ||
email: auth_hash['info']['email'], |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
No description provided.