Correct post deletion spec so it is async

This commit is contained in:
Sam
2017-07-28 10:50:18 -04:00
parent 64d54bc549
commit a13d146251
2 changed files with 15 additions and 12 deletions

View File

@ -64,9 +64,9 @@ QUnit.test('destroy by non-staff', assert => {
user = Discourse.User.create({username: 'evil trout'}),
post = buildPost({user: user, cooked: originalCooked});
post.destroy(user);
assert.ok(!post.get('can_delete'), "the post can't be deleted again in this session");
assert.ok(post.get('cooked') !== originalCooked, "the cooked content changed");
assert.equal(post.get('version'), 2, "the version number increased");
});
return post.destroy(user).then(() => {
assert.ok(!post.get('can_delete'), "the post can't be deleted again in this session");
assert.ok(post.get('cooked') !== originalCooked, "the cooked content changed");
assert.equal(post.get('version'), 2, "the version number increased");
});
});