From e55f2a0ff7ac025756f928173e6803bc0b163ef0 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 16 Feb 2015 15:59:58 +0000 Subject: [PATCH] test pack for getDocUpdates with version --- .../MongoManager/MongoManagerTests.coffee | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee b/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee index 2cac1fea0f..d0d1223d52 100644 --- a/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee +++ b/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee @@ -164,19 +164,29 @@ describe "MongoManager", -> describe "getDocUpdates", -> beforeEach -> @results = [ - {foo: "mock-update", v: 56}, - {foo: "mock-update", v: 55}, - {foo: "mock-update", v: 42}, - {foo: "mock-update", v: 41} + {foo: "mock-update", v: 56, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 55, doc_id: 100, project_id: 1}, + {pack: [ {foo: "mock-update", v: 54, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 53, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 52, doc_id: 100, project_id: 1} ] + , v: 52, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 42, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 41, doc_id: 100, project_id: 1} ] @updates_between = [ - {foo: "mock-update", v: 55}, - {foo: "mock-update", v: 42} + {foo: "mock-update", v: 55, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 54, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 53, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 52, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 42, doc_id: 100, project_id: 1} ] @updates_after = [ - {foo: "mock-update", v: 56}, - {foo: "mock-update", v: 55}, - {foo: "mock-update", v: 42} + {foo: "mock-update", v: 56, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 55, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 54, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 53, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 52, doc_id: 100, project_id: 1}, + {foo: "mock-update", v: 42, doc_id: 100, project_id: 1} ] @db.docHistory = {} @db.docHistory.find = sinon.stub().returns @db.docHistory