2013-10-02 22:59:57 +08:00
|
|
|
module("Discourse.FlaggedPost");
|
|
|
|
|
|
|
|
test('delete first post', function() {
|
2014-07-31 06:56:01 +08:00
|
|
|
sandbox.stub(Discourse, 'ajax');
|
2013-10-02 22:59:57 +08:00
|
|
|
|
|
|
|
Discourse.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() {
|
2014-07-31 06:56:01 +08:00
|
|
|
sandbox.stub(Discourse, 'ajax');
|
2013-10-02 22:59:57 +08:00
|
|
|
|
|
|
|
Discourse.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");
|
|
|
|
});
|