|
@@ -27,6 +27,7 @@ describe('RedisManager', function () {
|
|
|
lrange: sinon.stub(),
|
|
lrange: sinon.stub(),
|
|
|
lrem: sinon.stub(),
|
|
lrem: sinon.stub(),
|
|
|
srem: sinon.stub(),
|
|
srem: sinon.stub(),
|
|
|
|
|
+ del: sinon.stub(),
|
|
|
}
|
|
}
|
|
|
this.rclient.multi = sinon.stub().returns(this.rclient)
|
|
this.rclient.multi = sinon.stub().returns(this.rclient)
|
|
|
this.RedisWrapper = {
|
|
this.RedisWrapper = {
|
|
@@ -39,6 +40,9 @@ describe('RedisManager', function () {
|
|
|
projectHistoryOps({ project_id }) {
|
|
projectHistoryOps({ project_id }) {
|
|
|
return `Project:HistoryOps:${project_id}`
|
|
return `Project:HistoryOps:${project_id}`
|
|
|
},
|
|
},
|
|
|
|
|
+ projectHistoryFirstOpTimestamp({ project_id }) {
|
|
|
|
|
+ return `ProjectHistory:FirstOpTimestamp:{${project_id}}`
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -132,6 +136,12 @@ describe('RedisManager', function () {
|
|
|
.should.equal(true)
|
|
.should.equal(true)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ it('should clear the first op timestamp', function () {
|
|
|
|
|
+ return this.rclient.del
|
|
|
|
|
+ .calledWith(`ProjectHistory:FirstOpTimestamp:{${this.project_id}}`)
|
|
|
|
|
+ .should.equal(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
return it('should call the callback ', function () {
|
|
return it('should call the callback ', function () {
|
|
|
return this.callback.called.should.equal(true)
|
|
return this.callback.called.should.equal(true)
|
|
|
})
|
|
})
|