|
@@ -69,6 +69,7 @@ describe('Thread and post', () => {
|
|
|
res.should.have.status(200)
|
|
|
res.should.be.json
|
|
|
res.body.should.have.property('name', 'thread')
|
|
|
+ res.body.should.have.property('postCount', 0)
|
|
|
res.body.should.have.property('slug', 'thread')
|
|
|
res.body.should.have.deep.property('User.username', 'username')
|
|
|
res.body.should.have.deep.property('Category.name', 'category_name')
|
|
@@ -179,6 +180,7 @@ describe('Thread and post', () => {
|
|
|
res.body.should.have.property('content', '<p>content</p>\n')
|
|
|
res.body.should.have.deep.property('User.username', 'username')
|
|
|
res.body.should.have.deep.property('Thread.name', 'thread')
|
|
|
+ res.body.should.have.deep.property('Thread.postCount', 1)
|
|
|
|
|
|
})
|
|
|
it('should return an error if not logged in', async () => {
|
|
@@ -281,6 +283,7 @@ describe('Thread and post', () => {
|
|
|
res.body.should.have.property('content', '<p>another post</p>\n')
|
|
|
res.body.should.have.deep.property('User.username', 'username1')
|
|
|
res.body.should.have.deep.property('Thread.name', 'thread')
|
|
|
+ res.body.should.have.deep.property('Thread.postCount', 2)
|
|
|
res.body.should.have.property('replyingToUsername', 'username')
|
|
|
res.body.should.have.property('Replies').that.deep.equals([])
|
|
|
})
|