Renamed users:no-owner to users as main user fixture

- This fixture is the main user fixture you'd want to use when testing staff roles
- At the moment it has a weird name that makes it less likely people will use it
- A tiny step in trying to make our fixture system make a tiny bit more sense
This commit is contained in:
Hannah Wolfe 2022-09-02 09:49:17 +01:00
parent def4b8ba18
commit 588c9d04e8
No known key found for this signature in database
GPG Key ID: AB586C3B5AE5C037
10 changed files with 12 additions and 12 deletions

View File

@ -14,7 +14,7 @@ describe('Authors Content API', function () {
before(async function () {
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('owner:post', 'users:no-owner', 'user:inactive', 'posts', 'api_keys');
await testUtils.initFixtures('owner:post', 'users', 'user:inactive', 'posts', 'api_keys');
});
afterEach(function () {

View File

@ -18,7 +18,7 @@ describe('Pages Content API', function () {
before(async function () {
agent = await agentProvider.getContentAPIAgent();
await fixtureManager.init('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
await fixtureManager.init('users', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
await agent.authenticate();
});

View File

@ -27,7 +27,7 @@ describe('Posts Content API', function () {
before(async function () {
agent = await agentProvider.getContentAPIAgent();
await fixtureManager.init('owner:post', 'users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys', 'newsletters', 'members:newsletters');
await fixtureManager.init('owner:post', 'users', 'user:inactive', 'posts', 'tags:extra', 'api_keys', 'newsletters', 'members:newsletters');
await agent.authenticate();
// Assign a newsletter to one of the posts

View File

@ -15,7 +15,7 @@ describe('Tags Content API', function () {
before(async function () {
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
await testUtils.initFixtures('users', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
});
afterEach(function () {

View File

@ -25,7 +25,7 @@ describe('Update User Last Seen', function () {
await agent.loginAsOwner();
// Fixtures aren't working for roles. So need to use the owner for now.
/*await fixtureManager.init('roles', 'users:no-owner');
/*await fixtureManager.init('roles', 'users');
await agent.loginAs(
DataGenerator.Content.users[1].email,
DataGenerator.Content.users[1].password

View File

@ -12,7 +12,7 @@ describe('Authors Content API', function () {
before(async function () {
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('owner:post', 'users:no-owner', 'user:inactive', 'posts', 'api_keys');
await testUtils.initFixtures('owner:post', 'users', 'user:inactive', 'posts', 'api_keys');
});
afterEach(function () {

View File

@ -13,7 +13,7 @@ describe('api/endpoints/content/pages', function () {
before(async function () {
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
await testUtils.initFixtures('users', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
});
afterEach(function () {

View File

@ -13,7 +13,7 @@ describe('api/endpoints/content/posts', function () {
before(async function () {
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
await testUtils.initFixtures('users', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
});
afterEach(function () {

View File

@ -14,7 +14,7 @@ describe('api/endpoints/content/tags', function () {
before(async function () {
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
await testUtils.initFixtures('users:no-owner', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
await testUtils.initFixtures('users', 'user:inactive', 'posts', 'tags:extra', 'api_keys');
});
afterEach(function () {

View File

@ -277,7 +277,7 @@ const fixtures = {
});
},
createUsersWithoutOwner: async function createUsersWithoutOwner() {
ensureUserForEachRole: async function ensureUserForEachRole() {
const usersWithoutOwner = _.cloneDeep(DataGenerator.forKnex.users.slice(1));
let roles = await models.Role.fetchAll();
@ -739,8 +739,8 @@ const toDoList = {
'users:roles': function createUsersWithRoles() {
return fixtures.createUsersWithRoles();
},
'users:no-owner': function createUsersWithoutOwner() {
return fixtures.createUsersWithoutOwner();
users: function ensureUserForEachRole() {
return fixtures.ensureUserForEachRole();
},
'user:inactive': function createInactiveUser() {
return fixtures.createInactiveUser();