 			@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])
-			@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 return the document', ->
-			@callback
-				.calledWith(null, @lines, @version)
-				.should.equal true
-
-	describe "getDoc with an invalid project id", ->
-		beforeEach ->
-			@lines = ["one", "two", "three"]
-			@jsonlines = JSON.stringify @lines
-			@version = 42
-			@another_project_id = "project-id-456"
-			@rclient.get = sinon.stub()
-			@rclient.exec = sinon.stub().callsArgWith(0, null, [@jsonlines, @version, @another_project_id])
-			@RedisManager.getDoc @project_id, @doc_id, @callback
-
-		it 'should return an error', ->
-			@callback
-				.calledWith(new Errors.NotFoundError("not found"))
-				.should.equal true
+			@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", ->

				@rclient.set
					.calledWith("DocVersion:#{@doc_id}", @version)
					.should.equal true

			it "should push the doc op into the doc ops list", ->
				@rclient.rpush

		it "should set the version", ->
			@rclient.set
				.calledWith("DocVersion:#{@doc_id}", @version)
				.should.equal true
			
		it "should set the track changes entries", ->
			@rclient.set
				.calledWith("TrackChangesEntries:#{@doc_id}", JSON.stringify(@track_changes_entries))
				.should.equal true
			
		it "should set the track changes state", ->
			@rclient.set
				.calledWith("TrackChangesEnabled:#{@doc_id}", "1")
				.should.equal true
		
		it "should set the project_id for the doc", ->
