Replace this.server.db with this.server.schema (#2907)
This commit is contained in:
1 parent
89f33f3714
commit
961f497b6b
7 files changed
+21
-18
No files matched your search
@@ -47,8 +47,8 @@ module('Acceptance | managed-groups | members', function (hooks) {
|
||||
},
|
||||
'withAccountsAndUsersAndManagedGroups',
|
||||
);
|
||||
instances.managedGroup = this.server.schema.managedGroups.first();
|
||||
|
||||
instances.managedGroup = this.server.db.managedGroups[0];
|
||||
// Generate route URLs for resources
|
||||
urls.authMethods = `/scopes/${instances.scopes.org.id}/auth-methods`;
|
||||
urls.authMethod = `${urls.authMethods}/${instances.authMethod.id}`;
|
||||
|
||||
@@ -57,13 +57,16 @@ module('Acceptance | roles | delete', function (hooks) {
|
||||
});
|
||||
|
||||
test('can delete a role', async function (assert) {
|
||||
const rolesCount = this.server.db.roles.length;
|
||||
const rolesCount = this.server.schema.roles.all().models.length;
|
||||
await visit(urls.role);
|
||||
|
||||
await click(selectors.MANAGE_DROPDOWN_ROLES);
|
||||
await click(selectors.MANAGE_DROPDOWN_ROLES_REMOVE);
|
||||
|
||||
assert.strictEqual(this.server.db.roles.length, rolesCount - 1);
|
||||
assert.strictEqual(
|
||||
this.server.schema.roles.all().models.length,
|
||||
rolesCount - 1,
|
||||
);
|
||||
});
|
||||
|
||||
test('cannot delete a role without proper authorization', async function (assert) {
|
||||
|
||||
@@ -48,10 +48,11 @@ module('Acceptance | roles | principals', function (hooks) {
|
||||
},
|
||||
'withPrincipals',
|
||||
);
|
||||
|
||||
principalsCount =
|
||||
this.server.db.roles[0].userIds.length +
|
||||
this.server.db.roles[0].groupIds.length +
|
||||
this.server.db.roles[0].managedGroupIds.length;
|
||||
this.server.schema.roles.first().userIds.length +
|
||||
this.server.schema.roles.first().groupIds.length +
|
||||
this.server.schema.roles.first().managedGroupIds.length;
|
||||
urls.roles = `/scopes/${instances.scopes.org.id}/roles`;
|
||||
urls.role = `${urls.roles}/${instances.role.id}`;
|
||||
urls.rolePrincipals = `${urls.role}/principals`;
|
||||
|
||||
@@ -326,9 +326,9 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to account link for oidc account', async function (assert) {
|
||||
this.server.db.authMethods.remove();
|
||||
this.server.db.users.remove();
|
||||
this.server.db.accounts.remove();
|
||||
this.server.schema.authMethods.all().destroy();
|
||||
this.server.schema.users.all().destroy();
|
||||
this.server.schema.accounts.all().destroy();
|
||||
|
||||
const authMethod = this.server.create(
|
||||
'auth-method',
|
||||
@@ -355,9 +355,9 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
});
|
||||
|
||||
test('can navigate to account link for ldap account', async function (assert) {
|
||||
this.server.db.authMethods.remove();
|
||||
this.server.db.users.remove();
|
||||
this.server.db.accounts.remove();
|
||||
this.server.schema.authMethods.all().destroy();
|
||||
this.server.schema.users.all().destroy();
|
||||
this.server.schema.accounts.all().destroy();
|
||||
|
||||
const authMethod = this.server.create(
|
||||
'auth-method',
|
||||
|
||||
@@ -188,7 +188,7 @@ module('Acceptance | projects | sessions | index', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting empty sessions', async function (assert) {
|
||||
this.server.db.sessions.remove();
|
||||
this.server.schema.sessions.all().destroy();
|
||||
this.stubCacheDaemonSearch('sessions', 'sessions');
|
||||
await visit(urls.projects);
|
||||
|
||||
|
||||
@@ -205,8 +205,8 @@ module('Acceptance | projects | targets | index', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting targets list view with no targets', async function (assert) {
|
||||
this.server.db.targets.remove();
|
||||
this.server.db.sessions.remove();
|
||||
this.server.schema.targets.all().destroy();
|
||||
this.server.schema.sessions.all().destroy();
|
||||
this.stubCacheDaemonSearch('sessions', 'targets', 'aliases');
|
||||
|
||||
await visit(urls.projects);
|
||||
|
||||
@@ -265,9 +265,8 @@ module('Acceptance | scopes', function (hooks) {
|
||||
});
|
||||
|
||||
test('visiting empty targets', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.server.db.targets.remove();
|
||||
this.server.db.sessions.remove();
|
||||
this.server.schema.targets.all().destroy();
|
||||
this.server.schema.sessions.all().destroy();
|
||||
this.stubCacheDaemonSearch('sessions', 'targets', 'aliases');
|
||||
|
||||
await visit(urls.targets);
|
||||
|
||||
Reference in new issue
Block a user