 			@hash = crypto.createHash('sha1').update(JSON.stringify(@lines),'utf8').digest('hex')
 			@ranges = { comments: "mock", entries: "mock" }
 
-			@rclient.exec = sinon.stub().callsArg(0, null, [@hash])
+			@multi.exec = sinon.stub().callsArg(0, null, [@hash])
 
 		describe "with a consistent version", ->
 			beforeEach ->

			@json_ranges = JSON.stringify @ranges
			@unflushed_time = 12345
			@pathname = '/a/b/c.tex'
			@rclient.get = sinon.stub()
			@rclient.exec = sinon.stub().callsArgWith(0, null, [@jsonlines, @version, @hash, @project_id, @json_ranges, @pathname, @unflushed_time])
			@rclient.sadd = sinon.stub().yields(null, 0)

		describe "successfully", ->

				@RedisManager.updateDocument @doc_id, @lines, @version, @ops, @ranges, @callback

			it "should not call multi.exec", ->
				@multi.exec.called.should.equal false

			it "should call the callback with an error", ->
				@callback
