 				@callback
 					.calledWith(null, @lines, @version, @ranges)
 					.should.equal true
+
+			it 'should not log any errors', ->
+				@logger.error.calledWith()
+					.should.equal false
+
+		describe "with a corrupted document", ->
+			beforeEach ->
+				@badHash = "INVALID-HASH-VALUE"
+				@rclient.exec = sinon.stub().callsArgWith(0, null, [@jsonlines, @version, @badHash, @project_id, @json_ranges])
+				@RedisManager.getDoc @project_id, @doc_id, @callback
+
+			it 'should log a hash error', ->
+				@logger.error.calledWith()
+					.should.equal true
+
+			it 'should return the document', ->
+				@callback
+					.calledWith(null, @lines, @version, @ranges)
+					.should.equal true
+
 
 		describe "getDoc with an invalid project id", ->
 			beforeEach ->

			@lines = ["one", "two", "three"]
			@ops = [{ op: [{ i: "foo", p: 4 }] },{ op: [{ i: "bar", p: 8 }] }]
			@version = 42
			@ranges = { comments: "mock", entries: "mock" }

			@rclient.exec = sinon.stub().callsArg(0)

			@rclient.exec.yields()
			@lines = ["one", "two", "three"]
			@version = 42
			@hash = crypto.createHash('sha1').update(JSON.stringify(@lines)).digest('hex')
			@ranges = { comments: "mock", entries: "mock" }
		
		describe "with non-empty ranges", ->
