From af494dedf2fd14b1d4fb17631c21e83060947f00 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 1 Mar 2018 11:59:01 +0000 Subject: [PATCH] check project structure version in unit tests --- .../DocumentUpdater/DocumentUpdaterHandlerTests.coffee | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/services/web/test/unit/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee b/services/web/test/unit/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee index a4e0a4dc53..8db9ed4830 100644 --- a/services/web/test/unit/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee +++ b/services/web/test/unit/coffee/DocumentUpdater/DocumentUpdaterHandlerTests.coffee @@ -390,6 +390,8 @@ describe 'DocumentUpdaterHandler', -> describe "updateProjectStructure ", -> beforeEach -> @user_id = 1234 + @version = 999 + @Project.findOne = sinon.stub().callsArgWith(2,null, {_id: @project_id, version:@version}) describe "with project history disabled", -> beforeEach -> @@ -434,7 +436,7 @@ describe 'DocumentUpdaterHandler', -> @handler.updateProjectStructure @project_id, @user_id, @changes, () => @request.post - .calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id}) + .calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id, version:@version}) .should.equal true done() @@ -454,7 +456,7 @@ describe 'DocumentUpdaterHandler', -> @handler.updateProjectStructure @project_id, @user_id, @changes, () => @request.post - .calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id}) + .calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id, version:@version}) .should.equal true done() @@ -474,7 +476,7 @@ describe 'DocumentUpdaterHandler', -> @handler.updateProjectStructure @project_id, @user_id, @changes, () => @request.post - .calledWith(url: @url, json: {docUpdates: [], fileUpdates, userId: @user_id}) + .calledWith(url: @url, json: {docUpdates: [], fileUpdates, userId: @user_id, version:@version}) .should.equal true done() @@ -493,7 +495,7 @@ describe 'DocumentUpdaterHandler', -> @handler.updateProjectStructure @project_id, @user_id, @changes, () => @request.post - .calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id}) + .calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id, version:@version}) .should.equal true done()