Ensure version is still returned from redis

This commit is contained in:
James Allen
2014-02-26 14:49:52 +00:00
parent b13f70eadb
commit dfd3ec993b
4 changed files with 13 additions and 13 deletions
@@ -309,7 +309,7 @@ describe "DocOpsManager", ->
describe "pushDocOp", ->
beforeEach ->
@op = "mock-op"
@RedisManager.pushDocOp = sinon.stub().callsArg(2)
@RedisManager.pushDocOp = sinon.stub().callsArgWith(2, null, @version = 42)
@RedisManager.pushUncompressedHistoryOp = sinon.stub().callsArg(2)
@DocOpsManager.pushDocOp @project_id, @doc_id, @op, @callback
@@ -323,7 +323,7 @@ describe "DocOpsManager", ->
.calledWith(@doc_id, @op)
.should.equal true
it "should call the callback", ->
@callback.called.should.equal true
it "should call the callback with the version", ->
@callback.calledWith(null, @version).should.equal true
@@ -26,11 +26,8 @@ describe "ShareJsDB.writeOps", ->
@ShareJsDB.writeOp @doc_key, @opData, @callback
it "should write the op to redis", ->
op =
op: @opData.op
meta: @opData.meta
@DocOpsManager.pushDocOp
.calledWith(@project_id, @doc_id, op)
.calledWith(@project_id, @doc_id, @opData)
.should.equal true
it "should call the callback without an error", ->
@@ -46,7 +43,7 @@ describe "ShareJsDB.writeOps", ->
@ShareJsDB.writeOp @doc_key, @opData, @callback
it "should call the callback with an error", ->
@callback.calledWith(sinon.match.string).should.equal true
@callback.calledWith(new Error()).should.equal true