Merge pull request #1264 from sharelatex/hb-set-reversedHostname-on-user-create

Set reversedHostname on user creation

GitOrigin-RevId: 35ba4a5ae6aa792ee1c46e8b2b99d2e6ed00af17
This commit is contained in:
James Allen 2018-12-13 09:08:38 +00:00 committed by sharelatex
parent 65c1943c63
commit 3bc9ce995a
2 changed files with 2 additions and 0 deletions

View file

@ -25,6 +25,7 @@ module.exports = UserCreator =
user.emails = [
email: user.email
createdAt: new Date()
reversedHostname: user.email.split('@')[1].split('').reverse().join('')
]
user.save (err)->

View file

@ -78,6 +78,7 @@ describe "UserCreator", ->
user.emails.length.should.equal 1
user.emails[0].email.should.equal @email
user.emails[0].createdAt.should.be.a 'date'
user.emails[0].reversedHostname.should.equal "moc.liamg"
done()
it "should add affiliation in background", (done)->