diff --git a/services/web/app/coffee/Features/User/UserRegistrationHandler.coffee b/services/web/app/coffee/Features/User/UserRegistrationHandler.coffee index 9f15ed88d4..75a9debba4 100644 --- a/services/web/app/coffee/Features/User/UserRegistrationHandler.coffee +++ b/services/web/app/coffee/Features/User/UserRegistrationHandler.coffee @@ -36,7 +36,7 @@ module.exports = UserRegistrationHandler = _createNewUserIfRequired: (user, userDetails, callback)-> if !user? userDetails.holdingAccount = false - UserCreator.createNewUser userDetails, callback + UserCreator.createNewUser {holdingAccount:false, email:userDetails.email, first_name:userDetails.first_name, last_name:userDetails.last_name}, callback else callback null, user diff --git a/services/web/test/UnitTests/coffee/User/UserRegistrationHandlerTests.coffee b/services/web/test/UnitTests/coffee/User/UserRegistrationHandlerTests.coffee index 400d76c985..ec220e27f8 100644 --- a/services/web/test/UnitTests/coffee/User/UserRegistrationHandlerTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserRegistrationHandlerTests.coffee @@ -106,7 +106,7 @@ describe "UserRegistrationHandler", -> it "should create a new user", (done)-> @handler.registerNewUser @passingRequest, (err)=> - @UserCreator.createNewUser.calledWith({email:@passingRequest.email, holdingAccount:false, password:"123"}).should.equal true + @UserCreator.createNewUser.calledWith({email:@passingRequest.email, holdingAccount:false, first_name:@passingRequest.first_name, last_name:@passingRequest.last_name}).should.equal true done() it 'lower case email', (done)->