Merge pull request #2883 from overleaf/ta-email-remove-features-refresh

Refresh User's Features After Removing Email

GitOrigin-RevId: 0085a5341a806d1d22f4a1fb5bb98c93675e242e
This commit is contained in:
Shane Kilkelly 2020-06-04 09:47:02 +01:00 committed by Copybot
parent cab1335371
commit 74313e4b82
2 changed files with 13 additions and 1 deletions

View file

@ -155,7 +155,7 @@ const UserUpdater = {
if (res.n === 0) {
return callback(new Error('Cannot remove email'))
}
callback()
FeaturesUpdater.refreshFeatures(userId, callback)
})
})
},

View file

@ -293,6 +293,18 @@ describe('UserUpdater', function() {
)
})
it('refresh features', function(done) {
this.UserUpdater.removeEmailAddress(
this.stubbedUser._id,
this.newEmail,
err => {
should.not.exist(err)
sinon.assert.calledWith(this.refreshFeatures, this.stubbedUser._id)
done()
}
)
})
it('handle error', function(done) {
this.UserUpdater.updateUser = sinon
.stub()