Browse Source

Add test to reflect bug with Replies and ReplyingTo fields

sbkwgh 8 years ago
parent
commit
de0a7c475e
1 changed files with 9 additions and 0 deletions
  1. 9 0
      test/thread_post.js

+ 9 - 0
test/thread_post.js

@@ -279,6 +279,15 @@ describe('Thread and post', () => {
 			res.body.should.have.deep.property('User.username', 'username1')
 			res.body.should.have.deep.property('Thread.name', 'thread')
 			res.body.should.have.deep.property('ReplyingTo.User.username', 'username')
+			res.body.should.have.property('Replies', null)
+		})
+		it('should return any replies to a post', async () => {
+			let res = await replyAgent.get('/api/v1/post/1')
+
+			res.should.be.json
+			res.should.have.status(200)
+			res.body.should.have.deep.property('ReplyingTo', null)
+			res.body.should.have.deep.property('Replies.0.content', '<p>another post</p>\n')
 		})
 		it('should return an error if reply id does not exist', async () => {
 			try {