mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 04:23:43 +08:00
5c899c765b
This reverts commit c21457d6a7
.
22 lines
625 B
JavaScript
22 lines
625 B
JavaScript
import FlaggedPost from 'admin/models/flagged-post';
|
|
|
|
module("Discourse.FlaggedPost");
|
|
|
|
test('delete first post', function() {
|
|
sandbox.stub(Discourse, 'ajax');
|
|
|
|
FlaggedPost.create({ id: 1, topic_id: 2, post_number: 1 })
|
|
.deletePost();
|
|
|
|
ok(Discourse.ajax.calledWith("/t/2", { type: 'DELETE', cache: false }), "it deleted the topic");
|
|
});
|
|
|
|
test('delete second post', function() {
|
|
sandbox.stub(Discourse, 'ajax');
|
|
|
|
FlaggedPost.create({ id: 1, topic_id: 2, post_number: 2 })
|
|
.deletePost();
|
|
|
|
ok(Discourse.ajax.calledWith("/posts/1", { type: 'DELETE', cache: false }), "it deleted the post");
|
|
});
|