mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02:00
change acceptance test to use redis history client
This commit is contained in:
@@ -4,7 +4,7 @@ chai.should()
|
||||
expect = chai.expect
|
||||
async = require "async"
|
||||
Settings = require('settings-sharelatex')
|
||||
rclient_web = require("redis-sharelatex").createClient(Settings.redis.web)
|
||||
rclient_history = require("redis-sharelatex").createClient(Settings.redis.history)
|
||||
rclient_du = require("redis-sharelatex").createClient(Settings.redis.documentupdater)
|
||||
Keys = Settings.redis.documentupdater.key_schema
|
||||
|
||||
@@ -49,10 +49,10 @@ describe "Applying updates to a doc", ->
|
||||
done()
|
||||
|
||||
it "should push the applied updates to the track changes api", (done) ->
|
||||
rclient_web.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
|
||||
rclient_history.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
|
||||
throw error if error?
|
||||
JSON.parse(updates[0]).op.should.deep.equal @update.op
|
||||
rclient_web.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
|
||||
rclient_history.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
|
||||
throw error if error?
|
||||
result.should.equal 1
|
||||
done()
|
||||
@@ -82,9 +82,9 @@ describe "Applying updates to a doc", ->
|
||||
done()
|
||||
|
||||
it "should push the applied updates to the track changes api", (done) ->
|
||||
rclient_web.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
|
||||
rclient_history.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
|
||||
JSON.parse(updates[0]).op.should.deep.equal @update.op
|
||||
rclient_web.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
|
||||
rclient_history.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
|
||||
result.should.equal 1
|
||||
done()
|
||||
|
||||
@@ -127,12 +127,12 @@ describe "Applying updates to a doc", ->
|
||||
done()
|
||||
|
||||
it "should push the applied updates to the track changes api", (done) ->
|
||||
rclient_web.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
|
||||
rclient_history.lrange "UncompressedHistoryOps:#{@doc_id}", 0, -1, (error, updates) =>
|
||||
updates = (JSON.parse(u) for u in updates)
|
||||
for appliedUpdate, i in @updates
|
||||
appliedUpdate.op.should.deep.equal updates[i].op
|
||||
|
||||
rclient_web.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
|
||||
rclient_history.sismember "DocsWithHistoryOps:#{@project_id}", @doc_id, (error, result) =>
|
||||
result.should.equal 1
|
||||
done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user