explicit call to UserCreator.createNewUser

This commit is contained in:
Henry Oswald 2016-06-13 13:38:17 +01:00
parent 3bc3153490
commit f3e48e332b
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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)->