mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Correct post deletion spec so it is async
This commit is contained in:
parent
64d54bc549
commit
a13d146251
2 changed files with 15 additions and 12 deletions
|
@ -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");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue