Fix broken directory server config migration
This commit is contained in:
@@ -15,7 +15,7 @@ describe('Directory Server API', function () {
|
||||
before(setup);
|
||||
after(cleanup);
|
||||
|
||||
describe('user_directory_config', function () {
|
||||
describe('directory_server config', function () {
|
||||
// keep in sync with defaults in settings.js
|
||||
let defaultConfig = {
|
||||
enabled: false,
|
||||
@@ -23,7 +23,7 @@ describe('Directory Server API', function () {
|
||||
allowlist: ''
|
||||
};
|
||||
|
||||
it('can get user_directory_config (default)', async function () {
|
||||
it('can get directory_server config (default)', async function () {
|
||||
const response = await superagent.get(`${serverUrl}/api/v1/directory_server/config`)
|
||||
.query({ access_token: owner.token });
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('Directory Server API', function () {
|
||||
expect(response.body).to.eql(defaultConfig);
|
||||
});
|
||||
|
||||
it('cannot set user_directory_config without enabled boolean', async function () {
|
||||
it('cannot set directory_server config without enabled boolean', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
delete tmp.enabled;
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('Directory Server API', function () {
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('cannot set user_directory_config without secret', async function () {
|
||||
it('cannot set directory_server config without secret', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
delete tmp.secret;
|
||||
|
||||
@@ -55,7 +55,7 @@ describe('Directory Server API', function () {
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('cannot enable user_directory_config with empty secret', async function () {
|
||||
it('cannot enable directory_server config with empty secret', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
tmp.enabled = true;
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('Directory Server API', function () {
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('cannot enable user_directory_config with empty allowlist', async function () {
|
||||
it('cannot enable directory_server config with empty allowlist', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
tmp.enabled = true;
|
||||
tmp.secret = 'ldapsecret';
|
||||
@@ -80,7 +80,7 @@ describe('Directory Server API', function () {
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('can enable user_directory_config', async function () {
|
||||
it('can enable directory_server config', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
tmp.enabled = true;
|
||||
tmp.secret = 'ldapsecret';
|
||||
@@ -93,7 +93,7 @@ describe('Directory Server API', function () {
|
||||
expect(response.statusCode).to.equal(200);
|
||||
});
|
||||
|
||||
it('can get user_directory_config', async function () {
|
||||
it('can get directory_server config', async function () {
|
||||
let tmp = JSON.parse(JSON.stringify(defaultConfig));
|
||||
tmp.enabled = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user