 		describe "with no updates", ->
 			beforeEach ->
 				@RedisManager.getDocVersion.withArgs(@doc_id).yields(null, @version)
-				@RedisManager.updateDocument @doc_id, @lines, @version, [], @callback
+				@RedisManager.updateDocument @doc_id, @lines, @version, [], @track_changes_entries, @callback
 			
 			it "should not do an rpush", ->
 				@rclient.rpush

				projectKey: ({doc_id}) -> "ProjectId:#{doc_id}"
				pendingUpdates: ({doc_id}) -> "PendingUpdates:#{doc_id}"
				docsInProject: ({project_id}) -> "DocsIn:#{project_id}"
			"logger-sharelatex": @logger = { error: sinon.stub(), log: sinon.stub(), warn: sinon.stub() }
			"./Metrics": @metrics =
				inc: sinon.stub()

			@lines = ["one", "two", "three"]
			@jsonlines = JSON.stringify @lines
			@version = 42
			@track_changes_on = true
			@redis_track_changes_on = "1"
			@track_changes_entries = { comments: "mock", entries: "mock" }
			@json_track_changes_entries = JSON.stringify @track_changes_entries
			@rclient.get = sinon.stub()
			@rclient.exec = sinon.stub().callsArgWith(0, null, [@jsonlines, @version, @project_id, @redis_track_changes_on, @json_track_changes_entries])

		describe "successfully", ->
			beforeEach ->
				@RedisManager.getDoc @project_id, @doc_id, @callback

			it "should get the lines from redis", ->
				@rclient.get
					.calledWith("doclines:#{@doc_id}")
					.should.equal true
			
			it "should get the version from", ->
				@rclient.get
					.calledWith("DocVersion:#{@doc_id}")
					.should.equal true
			
			it "should get the track changes state", ->
				@rclient.get
					.calledWith("TrackChangesEnabled:#{@doc_id}")
					.should.equal true
			
			it "should get the track changes entries", ->
				@rclient.get
					.calledWith("TrackChangesEntries:#{@doc_id}")
					.should.equal true

			it 'should return the document', ->
				@callback
					.calledWith(null, @lines, @version, @track_changes_on, @track_changes_entries)
					.should.equal true

		describe "getDoc with an invalid project id", ->
			beforeEach ->
				@another_project_id = "project-id-456"
				@rclient.exec = sinon.stub().callsArgWith(0, null, [@jsonlines, @version, @another_project_id, @redis_track_changes_on, @json_track_changes_entries])
				@RedisManager.getDoc @project_id, @doc_id, @callback

			it 'should return an error', ->
				@callback
					.calledWith(new Errors.NotFoundError("not found"))
					.should.equal true

	describe "getPreviousDocOpsTests", ->
		describe "with a start and an end value", ->
