diff --git a/services/web/app/coffee/Features/Compile/ClsiManager.coffee b/services/web/app/coffee/Features/Compile/ClsiManager.coffee index 7ec267ede2..512bc54264 100755 --- a/services/web/app/coffee/Features/Compile/ClsiManager.coffee +++ b/services/web/app/coffee/Features/Compile/ClsiManager.coffee @@ -182,7 +182,6 @@ module.exports = ClsiManager = resources.push path: path content: doc.lines.join("\n") - rev: doc.rev if project.rootDoc_id? and doc._id.toString() == project.rootDoc_id.toString() rootResourcePath = path if options.rootDoc_id? and doc._id.toString() == options.rootDoc_id.toString() diff --git a/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee b/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee index 6bcde76444..651cb1b328 100644 --- a/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee +++ b/services/web/test/UnitTests/coffee/Compile/ClsiManagerTests.coffee @@ -12,6 +12,8 @@ describe "ClsiManager", -> getCookieJar: sinon.stub().callsArgWith(1, null, @jar) setServerId: sinon.stub().callsArgWith(2) _getServerId:sinon.stub() + @ClsiStateManager = + computeHash: sinon.stub().callsArgWith(1, null, "01234567890abcdef") @ClsiFormatChecker = checkRecoursesForProblems:sinon.stub().callsArgWith(1) @ClsiManager = SandboxedModule.require modulePath, requires: @@ -26,8 +28,11 @@ describe "ClsiManager", -> url: "https://clsipremium.example.com" "../../models/Project": Project: @Project = {} "../Project/ProjectEntityHandler": @ProjectEntityHandler = {} - "../DocumentUpdater/DocumentUpdaterHandler": @DocumentUpdaterHandler = {} + "../Project/ProjectGetter": @ProjectGetter = {} + "../DocumentUpdater/DocumentUpdaterHandler": @DocumentUpdaterHandler = + getProjectDocsIfMatch: sinon.stub().callsArgWith(2,null,null) "./ClsiCookieManager": @ClsiCookieManager + "./ClsiStateManager": @ClsiStateManager "logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub(), warn: sinon.stub() } "request": @request = sinon.stub() "./ClsiFormatChecker": @ClsiFormatChecker @@ -145,6 +150,7 @@ describe "ClsiManager", -> @Project.findById = sinon.stub().callsArgWith(2, null, @project) @ProjectEntityHandler.getAllDocs = sinon.stub().callsArgWith(1, null, @docs) @ProjectEntityHandler.getAllFiles = sinon.stub().callsArgWith(1, null, @files) + @ProjectGetter.getProject = sinon.stub().callsArgWith(2, null, @project) @DocumentUpdaterHandler.flushProjectToMongo = sinon.stub().callsArgWith(1, null) describe "with a valid project", -> @@ -154,8 +160,8 @@ describe "ClsiManager", -> done() it "should get the project with the required fields", -> - @Project.findById - .calledWith(@project_id, {compiler:1, rootDoc_id: 1, imageName: 1}) + @ProjectGetter.getProject + .calledWith(@project_id, {compiler:1, rootDoc_id: 1, imageName: 1, rootFolder: 1}) .should.equal true it "should flush the project to the database", -> @@ -182,6 +188,8 @@ describe "ClsiManager", -> imageName: @image draft: false check: undefined + syncType: "full" + syncState: "01234567890abcdef" rootResourcePath: "main.tex" resources: [{ path: "main.tex"