Moderators can edit posts that are queued before they approve/reject
This commit is contained in:
@@ -5,10 +5,6 @@ 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');
|
||||
@@ -18,12 +14,40 @@ test("approve a 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');
|
||||
});
|
||||
});
|
||||
|
||||
test("edit a post - cancel", () => {
|
||||
visit("/queued-posts");
|
||||
|
||||
click('.queued-post:eq(0) button.edit');
|
||||
andThen(() => {
|
||||
equal(find('.queued-post:eq(0) textarea').val(), 'queued post text', 'it shows an editor');
|
||||
});
|
||||
|
||||
fillIn('.queued-post:eq(0) textarea', 'new post text');
|
||||
click('.queued-post:eq(0) button.cancel');
|
||||
andThen(() => {
|
||||
ok(!exists('textarea'), 'it disables editing');
|
||||
equal(find('.queued-post:eq(0) .body p').text(), 'queued post text', 'it reverts the new text');
|
||||
});
|
||||
});
|
||||
|
||||
test("edit a post - confirm", () => {
|
||||
visit("/queued-posts");
|
||||
|
||||
click('.queued-post:eq(0) button.edit');
|
||||
andThen(() => {
|
||||
equal(find('.queued-post:eq(0) textarea').val(), 'queued post text', 'it shows an editor');
|
||||
});
|
||||
|
||||
fillIn('.queued-post:eq(0) textarea', 'new post text');
|
||||
click('.queued-post:eq(0) button.confirm');
|
||||
andThen(() => {
|
||||
ok(!exists('textarea'), 'it disables editing');
|
||||
equal(find('.queued-post:eq(0) .body p').text(), 'new post text', 'it has the new text');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@ export default function() {
|
||||
|
||||
this.get('/queued_posts', function() {
|
||||
return response({
|
||||
queued_posts: [{id: 1}]
|
||||
queued_posts: [{id: 1, raw: 'queued post text'}]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user