fix tests

This commit is contained in:
Brian Gough 2015-09-23 15:34:36 +01:00
parent dc0044020f
commit bdf1d267f0
3 changed files with 6 additions and 3 deletions

View file

@ -61,8 +61,10 @@ describe "DocArchiveManager", ->
beforeEach ->
@update = { _id: ObjectId(), op: "op", meta: "meta", v: "v"}
@MongoManager.getDocChangesCount = sinon.stub().callsArg(1)
@MongoManager.getArchivedDocChanges = sinon.stub().callsArgWith(1, null, 0)
@MongoManager.getLastCompressedUpdate = sinon.stub().callsArgWith(1, null, @update)
@MongoAWS.archiveDocHistory = sinon.stub().callsArg(2)
@MongoAWS.archiveDocHistory = sinon.stub().callsArg(3)
@MongoManager.markDocHistoryAsArchiveInProgress = sinon.stub().callsArg(2)
@MongoManager.markDocHistoryAsArchived = sinon.stub().callsArg(2)
@DocArchiveManager.archiveDocChanges @project_id, @doc_id, @callback

View file

@ -27,6 +27,7 @@ describe "MongoAWS", ->
@project_id = ObjectId().toString()
@doc_id = ObjectId().toString()
@update = { v:123 }
@callback = sinon.stub()
describe "archiveDocHistory", ->
@ -46,7 +47,7 @@ describe "MongoAWS", ->
cb()
@JSONStream.stringify = sinon.stub()
@MongoAWS.archiveDocHistory @project_id, @doc_id, @callback
@MongoAWS.archiveDocHistory @project_id, @doc_id, @update, @callback
it "should call the callback", ->
@callback.called.should.equal true

View file

@ -446,7 +446,7 @@ describe "MongoManager", ->
@db.docHistory.count
.calledWith({
doc_id: ObjectId(@doc_id)
inS3 : true
inS3: {$exists: true}
}, {
})
.should.equal true