From 43c4531e5107e76a74c6ecc9c4507691c1b12bda Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 28 May 2015 13:02:08 +0100 Subject: [PATCH] kill off CollaboratorsHandler. changeUsersPrivilegeLevel as it is not used anywhere --- .../Collaborators/CollaboratorsHandler.coffee | 5 ----- .../Collaborators/CollaboratorsHandlerTests.coffee | 13 ------------- 2 files changed, 18 deletions(-) diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee index f428b9bb14..1e0e6578af 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee @@ -19,11 +19,6 @@ module.exports = logger.err err: err, "problem removing user from project collaberators" callback(err) - changeUsersPrivilegeLevel: (project_id, user_id, newPrivalageLevel, callback = ->)-> - @removeUserFromProject project_id, user_id, => - User.findById user_id, (err, user)=> - @addUserToProject project_id, user_id, newPrivalageLevel, callback - addUserToProject: (project_id, email, privilegeLevel, callback)-> emails = mimelib.parseAddresses(email) email = emails[0]?.address?.toLowerCase() diff --git a/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee b/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee index b96c95cae0..c2439a7771 100644 --- a/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee +++ b/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee @@ -31,19 +31,6 @@ describe "CollaboratorsHandler", -> @project_id = "123l2j13lkj" @user_id = "132kj1lk2j" - describe "changeUsersPrivilegeLevel", -> - - - it "should call removeUserFromProject then addUserToProject", (done)-> - @CollaboratorHandler.removeUserFromProject = sinon.stub().callsArgWith(2) - @CollaboratorHandler.addUserToProject = sinon.stub().callsArgWith(3) - newPrivalageLevel = "readAndWrite" - @CollaboratorHandler.changeUsersPrivilegeLevel @project_id, @user_id, newPrivalageLevel, => - @CollaboratorHandler.removeUserFromProject.calledWith(@project_id, @user_id).should.equal true - @CollaboratorHandler.addUserToProject.calledWith(@project_id, @user_id, newPrivalageLevel) - done() - - describe "removeUserFromProject", -> beforeEach ->