mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Fixed test query using outdated author_id
filter
refs https://github.com/TryGhost/Toolbox/issues/230 - The `author_id` column is gone, so is the support for filtering posts by single author's id. Using author's slug(s) is the closest alternative to achieve the same result
This commit is contained in:
parent
15951aa1d5
commit
a372a84e82
@ -198,10 +198,11 @@ describe('User API', function () {
|
||||
|
||||
it('Can destroy an active user and transfer posts to the owner', async function () {
|
||||
const userId = testUtils.getExistingData().users[1].id;
|
||||
const userSlug = testUtils.getExistingData().users[1].slug;
|
||||
const ownerId = testUtils.getExistingData().users[0].id;
|
||||
|
||||
const res = await request
|
||||
.get(localUtils.API.getApiQuery(`posts/?filter=author_id:${userId}`))
|
||||
.get(localUtils.API.getApiQuery(`posts/?filter=authors:${userSlug}`))
|
||||
.set('Origin', config.get('url'))
|
||||
.expect(200);
|
||||
|
||||
@ -243,7 +244,7 @@ describe('User API', function () {
|
||||
.expect(404);
|
||||
|
||||
const res3 = await request
|
||||
.get(localUtils.API.getApiQuery(`posts/?filter=author_id:${userId}`))
|
||||
.get(localUtils.API.getApiQuery(`posts/?filter=authors:${userSlug}}`))
|
||||
.set('Origin', config.get('url'))
|
||||
.expect(200);
|
||||
|
||||
|
@ -41,7 +41,7 @@ let totalBoots = 0;
|
||||
const exposeFixtures = async () => {
|
||||
const fixturePromises = {
|
||||
roles: models.Role.findAll({columns: ['id']}),
|
||||
users: models.User.findAll({columns: ['id', 'email']}),
|
||||
users: models.User.findAll({columns: ['id', 'email', 'slug']}),
|
||||
tags: models.Tag.findAll({columns: ['id']}),
|
||||
apiKeys: models.ApiKey.findAll({withRelated: 'integration'})
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user