clear rootDoc_id when deleting doc, reset on compiles if invalid

GitOrigin-RevId: 539982adbf55014400f4aff94195e7f567cda676
This commit is contained in:
Ersun Warncke
2020-02-06 04:18:37 +00:00
committed by Copybot
parent 0d67c9382c
commit 74ecb4bebe
5 changed files with 83 additions and 21 deletions
@@ -120,14 +120,12 @@ describe('CompileController', function() {
})
it('should set the content-type of the response to application/json', function() {
return this.res.contentType
.calledWith('application/json')
.should.equal(true)
this.res.type.should.equal('application/json')
})
it('should send a successful response reporting the status and files', function() {
this.res.statusCode.should.equal(200)
return this.res.body.should.equal(
this.res.body.should.equal(
JSON.stringify({
status: this.status,
outputFiles: this.outputFiles
@@ -76,7 +76,7 @@ describe('CompileManager', function() {
this.CompileManager._checkIfRecentlyCompiled = sinon
.stub()
.callsArgWith(2, null, false)
this.ProjectRootDocManager.ensureRootDocumentIsSet = sinon
this.ProjectRootDocManager.ensureRootDocumentIsValid = sinon
.stub()
.callsArgWith(1, null)
this.CompileManager.getProjectCompileLimits = sinon
@@ -115,7 +115,7 @@ describe('CompileManager', function() {
})
it('should ensure that the root document is set', function() {
return this.ProjectRootDocManager.ensureRootDocumentIsSet
return this.ProjectRootDocManager.ensureRootDocumentIsValid
.calledWith(this.project_id)
.should.equal(true)
})