|
|
@@ -8,6 +8,7 @@ tk = require "timekeeper"
|
|
|
|
|
|
describe "DocumentManager", ->
|
|
|
beforeEach ->
|
|
|
+ tk.freeze(new Date())
|
|
|
@DocumentManager = SandboxedModule.require modulePath, requires:
|
|
|
"./RedisManager": @RedisManager = {}
|
|
|
"./ProjectHistoryRedisManager": @ProjectHistoryRedisManager = {}
|
|
|
@@ -35,6 +36,9 @@ describe "DocumentManager", ->
|
|
|
@pathname = '/a/b/c.tex'
|
|
|
@unflushedTime = Date.now()
|
|
|
|
|
|
+ afterEach ->
|
|
|
+ tk.reset()
|
|
|
+
|
|
|
describe "flushAndDeleteDoc", ->
|
|
|
describe "successfully", ->
|
|
|
beforeEach ->
|
|
|
@@ -394,12 +398,8 @@ describe "DocumentManager", ->
|
|
|
|
|
|
describe "getDocAndFlushIfOld", ->
|
|
|
beforeEach ->
|
|
|
- tk.freeze(new Date())
|
|
|
@DocumentManager.flushDocIfLoaded = sinon.stub().callsArg(2)
|
|
|
|
|
|
- afterEach ->
|
|
|
- tk.reset()
|
|
|
-
|
|
|
describe "when the doc is in Redis", ->
|
|
|
describe "and has changes to be flushed", ->
|
|
|
beforeEach ->
|