 
 	describe "updateDocument", ->
 		beforeEach ->
-			@rclient.set = sinon.stub()
-			@rclient.rpush = sinon.stub()
-			@rclient.expire = sinon.stub()
-			@rclient.ltrim = sinon.stub()
-			@rclient.del = sinon.stub()
-			@rclient.eval = sinon.stub()
+			@multi.set = sinon.stub()
+			@multi.rpush = sinon.stub()
+			@multi.expire = sinon.stub()
+			@multi.ltrim = sinon.stub()
+			@multi.del = sinon.stub()
+			@multi.eval = sinon.stub()
 			@RedisManager.getDocVersion = sinon.stub()
 
 			@lines = ["one", "two", "three", "これは"]


		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


				@RedisManager.getDoc @project_id, @doc_id, @callback

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

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

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

			it "should get the ranges", ->
				@multi.get
					.calledWith("Ranges:#{@doc_id}")
					.should.equal true

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

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

