kill off CollaboratorsHandler. changeUsersPrivilegeLevel as it is not used anywhere

This commit is contained in:
Henry Oswald 2015-05-28 13:02:08 +01:00
parent e454d2f059
commit 43c4531e51
2 changed files with 0 additions and 18 deletions

View file

@ -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()

View file

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