* VRFS-1386 - check if invited_user.email is nil, and change existing test to have email
This commit is contained in:
parent
3de73f2193
commit
5aaa389a4b
|
|
@ -780,7 +780,7 @@ module JamRuby
|
|||
# if you came in from an invite and used the same email to signup,
|
||||
# then we know you are a real human and that your email is valid.
|
||||
# lucky! we'll log you in immediately
|
||||
if invited_user.email.casecmp(user.email).zero?
|
||||
if invited_user.email && invited_user.email.casecmp(user.email).zero?
|
||||
user.email_confirmed = true
|
||||
user.signup_token = nil
|
||||
else
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class UsersController < ApplicationController
|
|||
|
||||
@fb_signup = load_facebook_signup(params)
|
||||
|
||||
# check if the email specified by @fb_signup already exists in the databse--if so, log them in and redirect
|
||||
# check if the email specified by @fb_signup already exists in the database--if so, log them in and redirect
|
||||
if @fb_signup && @fb_signup.email
|
||||
user = User.find_by_email_and_email_confirmed(@fb_signup, true)
|
||||
if user
|
||||
|
|
@ -117,7 +117,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# check if the uid specified by @fb_signup already exists in the databse--if so, log them in and redirect
|
||||
# check if the uid specified by @fb_signup already exists in the database--if so, log them in and redirect
|
||||
if @fb_signup && @fb_signup.uid
|
||||
user_authorization = UserAuthorization.find_by_uid_and_provider(@fb_signup.uid, 'facebook')
|
||||
# update user_authorization for user because this is fresher
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
|
|||
describe "can signup with facebook link multiple times with same invite" do
|
||||
before do
|
||||
@user = FactoryGirl.create(:user)
|
||||
@invited_user = FactoryGirl.create(:invited_user, :sender => @user, :autofriend => true, :email => "noone@jamkazam.com", :invite_medium => InvitedUser::FB_MEDIUM)
|
||||
@invited_user = FactoryGirl.create(:invited_user, :sender => @user, :autofriend => true, :email => nil, :invite_medium => InvitedUser::FB_MEDIUM)
|
||||
end
|
||||
|
||||
# Successful sign-in goes to the client
|
||||
|
|
|
|||
Loading…
Reference in New Issue