mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
if the main and last post is purged, purge the topic as well
This commit is contained in:
@@ -274,16 +274,16 @@ describe('Post\'s', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should purge posts and delete topic', function (done) {
|
||||
it('should purge posts and purge topic', function (done) {
|
||||
createTopicWithReply(function (topicPostData, replyData) {
|
||||
socketPosts.purgePosts({ uid: voterUid }, { pids: [replyData.pid, topicPostData.postData.pid], tid: topicPostData.topicData.tid }, function (err) {
|
||||
assert.ifError(err);
|
||||
posts.exists('post:' + replyData.pid, function (err, exists) {
|
||||
assert.ifError(err);
|
||||
assert.equal(exists, false);
|
||||
topics.getTopicField(topicPostData.topicData.tid, 'deleted', function (err, deleted) {
|
||||
topics.exists(topicPostData.topicData.tid, function (err, exists) {
|
||||
assert.ifError(err);
|
||||
assert.equal(parseInt(deleted, 10), 1);
|
||||
assert(!exists);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user