mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 15:49:01 +02:00
Merge pull request #2255 from overleaf/em-audit-log
Project audit logs GitOrigin-RevId: 439add2959be140c4f56ce9b41b9f59d432c494d
This commit is contained in:
committed by
sharelatex
parent
f6e4be616c
commit
06de9233b8
@@ -73,9 +73,6 @@ describe('ProjectController', function() {
|
||||
findAllUsersProjects: sinon.stub(),
|
||||
getProject: sinon.stub()
|
||||
}
|
||||
this.ProjectDetailsHandler = {
|
||||
transferOwnership: sinon.stub().yields()
|
||||
}
|
||||
this.ProjectHelper = {
|
||||
isArchived: sinon.stub(),
|
||||
isTrashed: sinon.stub(),
|
||||
@@ -1268,46 +1265,4 @@ describe('ProjectController', function() {
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('transferOwnership', function() {
|
||||
beforeEach(function() {
|
||||
this.req.body = { user_id: this.user._id.toString() }
|
||||
})
|
||||
|
||||
it('validates the request body', function(done) {
|
||||
this.req.body = {}
|
||||
this.ProjectController.transferOwnership(this.req, this.res, err => {
|
||||
expect(err).to.be.instanceof(HttpErrors.BadRequestError)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('returns 204 on success', function(done) {
|
||||
this.res.sendStatus = status => {
|
||||
expect(status).to.equal(204)
|
||||
done()
|
||||
}
|
||||
this.ProjectController.transferOwnership(this.req, this.res)
|
||||
})
|
||||
|
||||
it('returns 404 if the project does not exist', function(done) {
|
||||
this.ProjectDetailsHandler.transferOwnership.yields(
|
||||
new Errors.ProjectNotFoundError()
|
||||
)
|
||||
this.ProjectController.transferOwnership(this.req, this.res, err => {
|
||||
expect(err).to.be.instanceof(HttpErrors.NotFoundError)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('returns 404 if the user does not exist', function(done) {
|
||||
this.ProjectDetailsHandler.transferOwnership.yields(
|
||||
new Errors.UserNotFoundError()
|
||||
)
|
||||
this.ProjectController.transferOwnership(this.req, this.res, err => {
|
||||
expect(err).to.be.instanceof(HttpErrors.NotFoundError)
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user