moved renameEntity from collab manager to editor controller

This commit is contained in:
Henry Oswald
2014-04-04 16:35:02 +01:00
parent 3983e77b73
commit 88e47bbe12
4 changed files with 34 additions and 10 deletions
@@ -621,3 +621,25 @@ describe "EditorController", ->
@ProjectHandler::deleteProject.calledWith(@project_id).should.equal true
done()
describe "renameEntity", ->
beforeEach ->
@err = "errro"
@entity_id = "entity_id_here"
@entityType = "doc"
@newName = "bobsfile.tex"
@ProjectHandler::renameEntity = sinon.stub().callsArgWith(4, @err)
@EditorRealTimeController.emitToRoom = sinon.stub()
it "should call the project handler", (done)->
@EditorController.renameEntity @project_id, @entity_id, @entityType, @newName, =>
@ProjectHandler::renameEntity.calledWith(@project_id, @entity_id, @entityType, @newName).should.equal true
done()
it "should emit the update to the room", (done)->
@EditorController.renameEntity @project_id, @entity_id, @entityType, @newName, =>
@EditorRealTimeController.emitToRoom.calledWith(@project_id, 'reciveEntityRename', @entity_id, @newName).should.equal true
done()