Fix unit tests

This commit is contained in:
James Allen 2014-04-30 11:23:53 +01:00
parent 355a5a020e
commit d82ae02d23

View file

@ -180,21 +180,13 @@ describe 'project entity handler', ->
describe "a doc", -> describe "a doc", ->
beforeEach (done) -> beforeEach (done) ->
@ProjectEntityHandler._cleanUpEntity @project, _id: @entity_id, 'doc', done @ProjectEntityHandler._cleanUpDoc = sinon.stub().callsArg(3)
@ProjectEntityHandler._cleanUpEntity @project, @entity = {_id: @entity_id}, 'doc', done
it "should not attempted to delete from FileStoreHandler", -> it "should clean up the doc", ->
@FileStoreHandler.deleteFile.called.should.equal false @ProjectEntityHandler._cleanUpDoc
.calledWith(@project, @entity)
it "should delete the doc from the document updater", -> .should.equal true
@documentUpdaterHandler.deleteDoc.calledWith(project_id, @entity_id).should.equal true
describe "when the entity is the root document", ->
beforeEach (done) ->
@project.rootDoc_id = new ObjectId(@entity_id)
@ProjectEntityHandler._cleanUpEntity @project, _id: @entity_id, 'doc', done
it "should unset the root doc id", ->
@ProjectEntityHandler.unsetRootDoc.calledWith(project_id).should.equal true
describe "a folder", -> describe "a folder", ->
beforeEach (done) -> beforeEach (done) ->