mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
29 lines
758 B
CoffeeScript
29 lines
758 B
CoffeeScript
assert = require('chai').assert
|
|
sinon = require('sinon')
|
|
chai = require('chai')
|
|
should = chai.should()
|
|
modulePath = "../../../../app/js/RedisManager.js"
|
|
SandboxedModule = require('sandboxed-module')
|
|
|
|
doc_id = "1234"
|
|
|
|
describe 'Redis Manager.getUpdatesLength ', ->
|
|
|
|
beforeEach ->
|
|
|
|
@llenStub = sinon.stub()
|
|
@redisManager = SandboxedModule.require modulePath, requires:
|
|
"./ZipManager": {}
|
|
"logger-sharelatex": {}
|
|
"redis-sharelatex":
|
|
createClient:=>
|
|
auth:->
|
|
llen:@llenStub
|
|
|
|
it "should the number of things to process in the que", (done)->
|
|
|
|
@llenStub.callsArgWith(1, null, 3)
|
|
@redisManager.getUpdatesLength doc_id, (err, len)=>
|
|
@llenStub.calledWith("PendingUpdates:#{doc_id}").should.equal true
|
|
len.should.equal 3
|
|
done()
|