Fix unit tests

This commit is contained in:
Shane Kilkelly 2017-06-12 10:09:33 +01:00
parent 1bb065344c
commit c9432a1238
3 changed files with 5 additions and 3 deletions

View file

@ -92,7 +92,7 @@ describe 'LabelsController', ->
@EditorRealTimeController.emitToRoom.callCount.should.equal 1
lastCall = @EditorRealTimeController.emitToRoom.lastCall
expect(lastCall.args[0]).to.equal @projectId
expect(lastCall.args[1]).to.equal 'doc:labels:updated'
expect(lastCall.args[1]).to.equal 'docLabelsUpdated'
expect(lastCall.args[2]).to.have.all.keys ['docId', 'labels']
describe 'when LabelsHandler.getLabelsForDoc produces an error', ->

View file

@ -255,7 +255,7 @@ describe "FileSystemImportManager", ->
@FileSystemImportManager.addEntity @user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback
it "should call addFile", ->
@FileSystemImportManager.addFile.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback)
@FileSystemImportManager.addFile.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace)
.should.equal true
describe "with text file", ->
@ -267,7 +267,7 @@ describe "FileSystemImportManager", ->
@FileSystemImportManager.addEntity @user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback
it "should call addFile", ->
@FileSystemImportManager.addDoc.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback)
@FileSystemImportManager.addDoc.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace)
.should.equal true

View file

@ -121,6 +121,7 @@ describe "ProjectUploadController", ->
beforeEach ->
@entity =
_id : "1234"
type: 'file'
@FileSystemImportManager.addEntity = sinon.stub().callsArgWith(6, null, @entity)
@ProjectUploadController.uploadFile @req, @res
@ -133,6 +134,7 @@ describe "ProjectUploadController", ->
expect(@res.body).to.deep.equal
success: true
entity_id: @entity._id
entity_type: 'file'
it "should output a log line", ->
@logger.log