 				@RedisManager.updateDocument @doc_id, @lines, @version, @ops, @ranges, @callback
 
 			it "should not call multi.exec", ->
-				@rclient.exec.called.should.equal false
+				@multi.exec.called.should.equal false
 
 			it "should call the callback with an error", ->
 				@callback


		describe "when the document is not present", ->
			beforeEach ->
				@rclient.exec = sinon.stub().callsArgWith(0, null, [null, null, null, null, null, null, null])
				@rclient.sadd = sinon.stub().yields()
				@RedisManager.getDoc @project_id, @doc_id, @callback



	describe "removeDocFromMemory", ->
		beforeEach (done) ->
			@multi.del = sinon.stub()
			@multi.srem = sinon.stub()
			@multi.exec.yields()
			@RedisManager.removeDocFromMemory @project_id, @doc_id, done

		it "should delete the lines", ->
			@multi.del
				.calledWith("doclines:#{@doc_id}")
				.should.equal true

		it "should delete the version", ->
			@multi.del
				.calledWith("DocVersion:#{@doc_id}")
				.should.equal true

		it "should delete the hash", ->
			@multi.del
				.calledWith("DocHash:#{@doc_id}")
				.should.equal true

		it "should delete the unflushed time", ->
			@multi.del
				.calledWith("UnflushedTime:#{@doc_id}")
				.should.equal true

		it "should delete the project_id for the doc", ->
			@multi.del
				.calledWith("ProjectId:#{@doc_id}")
				.should.equal true

		it "should remove the doc_id from the project set", ->
			@multi.srem
				.calledWith("DocsIn:#{@project_id}", @doc_id)
				.should.equal true

		it "should delete the pathname for the doc", ->
			@multi.del
				.calledWith("Pathname:#{@doc_id}")
				.should.equal true

