From d599cfa7aca61fc1100a5296306c844b3c5ea5e6 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 1 Jul 2014 14:19:52 +0100 Subject: [PATCH] Fix unit tests --- .../UnitTests/coffee/Editor/EditorControllerTests.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee b/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee index 2f2335e19c..a5883f2720 100644 --- a/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Editor/EditorControllerTests.coffee @@ -296,6 +296,7 @@ describe "EditorController", -> @email = "Jane.Doe@example.com" @priveleges = "readOnly" @addedUser = { _id: "added-user" } + @ProjectEditorHandler.buildUserModelView = sinon.stub().returns(@addedUser) @CollaboratorsHandler.addUserToProject = sinon.stub().callsArgWith(3, null, @addedUser) @EditorRealTimeController.emitToRoom = sinon.stub() @callback = sinon.stub() @@ -314,9 +315,9 @@ describe "EditorController", -> @EditorRealTimeController.emitToRoom.calledWith(@project_id, "userAddedToProject", @addedUser).should.equal true done() - it "should return true to the callback", (done)-> + it "should return the user to the callback", (done)-> @EditorController.addUserToProject @project_id, @email, @priveleges, (err, result)=> - result.should.equal true + result.should.equal @addedUser done()