 	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 ->


					@handler.updateProjectStructure @project_id, @user_id, @changes, () =>
						@request.post
							.calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id})
							.should.equal true
						done()



					@handler.updateProjectStructure @project_id, @user_id, @changes, () =>
						@request.post
							.calledWith(url: @url, json: {docUpdates, fileUpdates: [], userId: @user_id, version:@version})
							.should.equal true
						done()

