Merge pull request #3277 from overleaf/revert-3257-jpa-mongoose-latest

Revert "[misc] upgrade mongoose to the latest version"

GitOrigin-RevId: d5957fca68be65a08a687476742ffbb9c3cb86e8
This commit is contained in:
Simon Detheridge
2020-10-12 13:35:50 +01:00
committed by Copybot
parent dba5127856
commit c257b9695a
59 changed files with 655 additions and 445 deletions
@@ -83,9 +83,7 @@ describe('ProjectHistoryHandler', function() {
.stub()
.withArgs(project_id)
.callsArgWith(1, null, this.project)
this.ProjectModel.updateOne = sinon
.stub()
.callsArgWith(2, null, { n: 1 })
this.ProjectModel.update = sinon.stub().callsArgWith(2, null, { n: 1 })
return this.ProjectHistoryHandler.ensureHistoryExistsForProject(
project_id,
this.callback
@@ -103,7 +101,7 @@ describe('ProjectHistoryHandler', function() {
})
it('should set the new history id on the project', function() {
return this.ProjectModel.updateOne
return this.ProjectModel.update
.calledWith(
{ _id: project_id, 'overleaf.history.id': { $exists: false } },
{ 'overleaf.history.id': this.newHistoryId }
@@ -135,7 +133,7 @@ describe('ProjectHistoryHandler', function() {
.stub()
.withArgs(project_id)
.callsArgWith(1, null, this.project)
this.ProjectModel.updateOne = sinon.stub()
this.ProjectModel.update = sinon.stub()
return this.ProjectHistoryHandler.ensureHistoryExistsForProject(
project_id,
this.callback
@@ -153,7 +151,7 @@ describe('ProjectHistoryHandler', function() {
})
it('should not set the new history id on the project', function() {
return this.ProjectModel.updateOne.called.should.equal(false)
return this.ProjectModel.update.called.should.equal(false)
})
it('should not resync the project history', function() {