From 76d1350593dd0405db16f47f262a1314c05dd700 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 5 Jun 2015 10:59:09 +0100 Subject: [PATCH] fix unit tests packManager now uses LockManager, which tries to talk to redis and needs to be replaced by a stub in the unit tests. --- .../test/unit/coffee/HttpController/HttpControllerTests.coffee | 1 + .../test/unit/coffee/MongoManager/MongoManagerTests.coffee | 3 +++ 2 files changed, 4 insertions(+) diff --git a/services/track-changes/test/unit/coffee/HttpController/HttpControllerTests.coffee b/services/track-changes/test/unit/coffee/HttpController/HttpControllerTests.coffee index f756cbb0e6..7c559c0937 100644 --- a/services/track-changes/test/unit/coffee/HttpController/HttpControllerTests.coffee +++ b/services/track-changes/test/unit/coffee/HttpController/HttpControllerTests.coffee @@ -12,6 +12,7 @@ describe "HttpController", -> "./UpdatesManager": @UpdatesManager = {} "./DiffManager": @DiffManager = {} "./RestoreManager": @RestoreManager = {} + "./PackManager": @PackManager = {} @doc_id = "doc-id-123" @project_id = "project-id-123" @next = sinon.stub() diff --git a/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee b/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee index bb9162bb6c..24588de6ea 100644 --- a/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee +++ b/services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee @@ -3,6 +3,7 @@ chai = require('chai') should = chai.should() expect = chai.expect modulePath = "../../../../app/js/MongoManager.js" +packModulePath = "../../../../app/js/PackManager.js" SandboxedModule = require('sandboxed-module') {ObjectId} = require("mongojs") tk = require "timekeeper" @@ -12,6 +13,8 @@ describe "MongoManager", -> tk.freeze(new Date()) @MongoManager = SandboxedModule.require modulePath, requires: "./mongojs" : { db: @db = {}, ObjectId: ObjectId } + "./PackManager" : SandboxedModule.require packModulePath, requires: + "./LockManager" : {} @callback = sinon.stub() @doc_id = ObjectId().toString() @project_id = ObjectId().toString()