diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb index 4fbd8369ea9..7791246fe6e 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -51,10 +51,10 @@ def create def add_conference_user # check if user is already present with given username in system - existing_user = User.find_by(username: params[:user][:username]) + existing_user = User.find_by(username: params[:user][:name]) # if user exist then add user as participant to assignment else create account and then add as participant if existing_user.nil? - if !User.find_by(email: params[:user][:email]).nil? || (params[:user][:username].nil? || params[:user][:username].empty?) + if !User.find_by(email: params[:user][:email]).nil? || (params[:user][:name].nil? || params[:user][:name].empty?) flash[:error] = 'A user with username of this email already exists, Please provide a unique email to continue.' # redirect_to request.referrer return false diff --git a/spec/controllers/conference_controller_spec.rb b/spec/controllers/conference_controller_spec.rb index b334258c6a0..59b0c9637a8 100644 --- a/spec/controllers/conference_controller_spec.rb +++ b/spec/controllers/conference_controller_spec.rb @@ -75,7 +75,7 @@ end it 'return error if user email already exist' do request_params = { - user: { username: 'lily', + user: { name: 'lily', role_id: 2, email: 'chenzy@gmail.com', fullname: 'John Bumgardner', diff --git a/spec/controllers/invitations_controller_spec.rb b/spec/controllers/invitations_controller_spec.rb index c955903360c..8e4ea76bb59 100644 --- a/spec/controllers/invitations_controller_spec.rb +++ b/spec/controllers/invitations_controller_spec.rb @@ -47,7 +47,7 @@ allow(AssignmentParticipant).to receive(:find).with('1').and_return(participant) allow(Assignment).to receive(:find).with(1).and_return(assignment) request_params = { - user: { name: 'student@gmail.com', email: 'student@gmail.com' }, + user: { username: 'student@gmail.com', email: 'student@gmail.com' }, student_id: 1 } user_session = { user: student }