From 625f83af0992994ab2c74926b6248a7866cf78e0 Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 2 May 2022 11:42:10 +0800 Subject: [PATCH] Cleaned up schedules test suite from author_id field refs https://github.com/TryGhost/Toolbox/issues/230 - The `author_id` is ignored in the API of Ghost 5.0 and should not be used in the fixtures either --- test/regression/api/admin/schedules.test.js | 30 ++++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/test/regression/api/admin/schedules.test.js b/test/regression/api/admin/schedules.test.js index 0d8c7bdb80..c796e4eb57 100644 --- a/test/regression/api/admin/schedules.test.js +++ b/test/regression/api/admin/schedules.test.js @@ -32,48 +32,58 @@ describe('Canary Schedules API', function () { resources.push(testUtils.DataGenerator.forKnex.createPost({ created_by: testUtils.getExistingData().users[0].id, - author_id: testUtils.getExistingData().users[0].id, published_by: testUtils.getExistingData().users[0].id, published_at: moment().add(30, 'seconds').toDate(), status: 'scheduled', - slug: 'first' + slug: 'first', + authors: [{ + id: testUtils.getExistingData().users[0].id + }] })); resources.push(testUtils.DataGenerator.forKnex.createPost({ created_by: testUtils.getExistingData().users[0].id, - author_id: testUtils.getExistingData().users[0].id, published_by: testUtils.getExistingData().users[0].id, published_at: moment().subtract(30, 'seconds').toDate(), status: 'scheduled', - slug: 'second' + slug: 'second', + authors: [{ + id: testUtils.getExistingData().users[0].id + }] })); resources.push(testUtils.DataGenerator.forKnex.createPost({ created_by: testUtils.getExistingData().users[0].id, - author_id: testUtils.getExistingData().users[0].id, published_by: testUtils.getExistingData().users[0].id, published_at: moment().add(10, 'minute').toDate(), status: 'scheduled', - slug: 'third' + slug: 'third', + authors: [{ + id: testUtils.getExistingData().users[0].id + }] })); resources.push(testUtils.DataGenerator.forKnex.createPost({ created_by: testUtils.getExistingData().users[0].id, - author_id: testUtils.getExistingData().users[0].id, published_by: testUtils.getExistingData().users[0].id, published_at: moment().subtract(10, 'minute').toDate(), status: 'scheduled', - slug: 'fourth' + slug: 'fourth', + authors: [{ + id: testUtils.getExistingData().users[0].id + }] })); resources.push(testUtils.DataGenerator.forKnex.createPost({ created_by: testUtils.getExistingData().users[0].id, - author_id: testUtils.getExistingData().users[0].id, published_by: testUtils.getExistingData().users[0].id, published_at: moment().add(30, 'seconds').toDate(), status: 'scheduled', slug: 'fifth', - type: 'page' + type: 'page', + authors: [{ + id: testUtils.getExistingData().users[0].id + }] })); const result = await Promise.mapSeries(resources, function (post) {