mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Interface for reviewing queued posts
This commit is contained in:
29
test/javascripts/acceptance/queued-posts-test.js.es6
Normal file
29
test/javascripts/acceptance/queued-posts-test.js.es6
Normal file
@@ -0,0 +1,29 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Queued Posts", { loggedIn: true });
|
||||
|
||||
test("approve a post", () => {
|
||||
visit("/queued-posts");
|
||||
|
||||
andThen(() => {
|
||||
ok(exists('.queued-post'), 'it has posts listed');
|
||||
});
|
||||
|
||||
click('.queued-post:eq(0) button.approve');
|
||||
andThen(() => {
|
||||
ok(!exists('.queued-post'), 'it removes the post');
|
||||
});
|
||||
});
|
||||
|
||||
test("reject a post", () => {
|
||||
visit("/queued-posts");
|
||||
|
||||
andThen(() => {
|
||||
ok(exists('.queued-post'), 'it has posts listed');
|
||||
});
|
||||
|
||||
click('.queued-post:eq(0) button.reject');
|
||||
andThen(() => {
|
||||
ok(!exists('.queued-post'), 'it removes the post');
|
||||
});
|
||||
});
|
||||
@@ -94,6 +94,16 @@ export default function() {
|
||||
return response({});
|
||||
});
|
||||
|
||||
this.put('/queued_posts/:queued_post_id', function(request) {
|
||||
return response({ queued_post: {id: request.params.queued_post_id } });
|
||||
});
|
||||
|
||||
this.get('/queued_posts', function() {
|
||||
return response({
|
||||
queued_posts: [{id: 1}]
|
||||
});
|
||||
});
|
||||
|
||||
this.post('/session', function(request) {
|
||||
const data = parsePostData(request.requestBody);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user