mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 14:19:01 +02:00
Move admin register to user activate module
Move admin register to user activate module Co-authored-by: John Lees-Miller <jdleesmiller@gmail.com> & Davinder Singh GitOrigin-RevId: 79428f2932783086435bdad9b1efb5300c467511
This commit is contained in:
@@ -43,7 +43,6 @@ describe('UserController', function () {
|
||||
}
|
||||
this.User = { findById: sinon.stub().callsArgWith(1, null, this.user) }
|
||||
this.NewsLetterManager = { unsubscribe: sinon.stub().callsArgWith(1) }
|
||||
this.UserRegistrationHandler = { registerNewUser: sinon.stub() }
|
||||
this.AuthenticationController = {
|
||||
establishUserSession: sinon.stub().callsArg(2),
|
||||
}
|
||||
@@ -104,7 +103,6 @@ describe('UserController', function () {
|
||||
User: this.User,
|
||||
},
|
||||
'../Newsletter/NewsletterManager': this.NewsLetterManager,
|
||||
'./UserRegistrationHandler': this.UserRegistrationHandler,
|
||||
'../Authentication/AuthenticationController':
|
||||
this.AuthenticationController,
|
||||
'../Authentication/SessionManager': this.SessionManager,
|
||||
@@ -558,32 +556,6 @@ describe('UserController', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('register', function () {
|
||||
beforeEach(function () {
|
||||
this.UserRegistrationHandler.registerNewUserAndSendActivationEmail = sinon
|
||||
.stub()
|
||||
.callsArgWith(1, null, this.user, (this.url = 'mock/url'))
|
||||
this.req.body.email = this.user.email = this.email = 'email@example.com'
|
||||
this.UserController.register(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should register the user and send them an email', function () {
|
||||
sinon.assert.calledWith(
|
||||
this.UserRegistrationHandler.registerNewUserAndSendActivationEmail,
|
||||
this.email
|
||||
)
|
||||
})
|
||||
|
||||
it('should return the user and activation url', function () {
|
||||
this.res.json
|
||||
.calledWith({
|
||||
email: this.email,
|
||||
setNewPasswordUrl: this.url,
|
||||
})
|
||||
.should.equal(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('clearSessions', function () {
|
||||
describe('success', function () {
|
||||
it('should call revokeAllUserSessions', function (done) {
|
||||
|
||||
Reference in New Issue
Block a user