Changed organisation* to organization* in descriptions, comments and endoints ✏

ref #117
This commit is contained in:
2021-01-24 18:34:15 +01:00
parent 5660aecb50
commit ef15d0d576
46 changed files with 145 additions and 145 deletions

View File

@@ -14,24 +14,24 @@ beforeAll(async () => {
};
});
describe('GET /api/organisations', () => {
describe('GET /api/organizations', () => {
it('basic get should return 200', async () => {
const res = await axios.get(base + '/api/organisations', axios_config);
const res = await axios.get(base + '/api/organizations', axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
});
});
// ---------------
describe('POST /api/organisations', () => {
describe('POST /api/organizations', () => {
it('creating a new org with just a name should return 200', async () => {
const res = await axios.post(base + '/api/organisations', {
const res = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
});
it('creating a new org with without a name should return 400', async () => {
const res = await axios.post(base + '/api/organisations', {
const res = await axios.post(base + '/api/organizations', {
"name": null
}, axios_config);
expect(res.status).toEqual(400);
@@ -41,14 +41,14 @@ describe('POST /api/organisations', () => {
// ---------------
describe('adding + getting from all orgs', () => {
it('creating a new org with just a name should return 200', async () => {
const res = await axios.post(base + '/api/organisations', {
const res = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
});
it('check if org was added', async () => {
const res = await axios.get(base + '/api/organisations', axios_config);
const res = await axios.get(base + '/api/organizations', axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
let added_org = res.data[res.data.length - 1]
@@ -72,7 +72,7 @@ describe('adding + getting from all orgs', () => {
describe('adding + getting explicitly', () => {
let added_org_id
it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', {
const res1 = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
let added_org = res1.data
@@ -81,7 +81,7 @@ describe('adding + getting explicitly', () => {
expect(res1.headers['content-type']).toContain("application/json")
});
it('check if org was added', async () => {
const res2 = await axios.get(base + '/api/organisations/' + added_org_id, axios_config);
const res2 = await axios.get(base + '/api/organizations/' + added_org_id, axios_config);
expect(res2.status).toEqual(200);
expect(res2.headers['content-type']).toContain("application/json")
let added_org2 = res2.data

View File

@@ -17,7 +17,7 @@ beforeAll(async () => {
// ---------------
describe('adding + deletion (non-existant)', () => {
it('delete', async () => {
const res2 = await axios.delete(base + '/api/organisations/0', axios_config);
const res2 = await axios.delete(base + '/api/organizations/0', axios_config);
expect(res2.status).toEqual(204);
});
});
@@ -26,7 +26,7 @@ describe('adding + deletion (successfull)', () => {
let added_org_id
let added_org
it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', {
const res1 = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
added_org = res1.data
@@ -35,7 +35,7 @@ describe('adding + deletion (successfull)', () => {
expect(res1.headers['content-type']).toContain("application/json")
});
it('delete', async () => {
const res2 = await axios.delete(base + '/api/organisations/' + added_org_id, axios_config);
const res2 = await axios.delete(base + '/api/organizations/' + added_org_id, axios_config);
expect(res2.status).toEqual(200);
expect(res2.headers['content-type']).toContain("application/json")
let added_org2 = res2.data
@@ -56,7 +56,7 @@ describe('adding + deletion (successfull)', () => {
});
});
it('check if org really was deleted', async () => {
const res3 = await axios.get(base + '/api/organisations/' + added_org_id, axios_config);
const res3 = await axios.get(base + '/api/organizations/' + added_org_id, axios_config);
expect(res3.status).toEqual(404);
expect(res3.headers['content-type']).toContain("application/json")
});
@@ -68,7 +68,7 @@ describe('adding + deletion with teams still existing (without force)', () => {
let added_team;
let added_team_id
it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', {
const res1 = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
added_org = res1.data;
@@ -87,7 +87,7 @@ describe('adding + deletion with teams still existing (without force)', () => {
expect(res2.headers['content-type']).toContain("application/json")
});
it('delete org - this should fail with a 406', async () => {
const res2 = await axios.delete(base + '/api/organisations/' + added_org_id, axios_config);
const res2 = await axios.delete(base + '/api/organizations/' + added_org_id, axios_config);
expect(res2.status).toEqual(406);
expect(res2.headers['content-type']).toContain("application/json")
});
@@ -99,7 +99,7 @@ describe('adding + deletion with teams still existing (with force)', () => {
let added_team;
let added_team_id
it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', {
const res1 = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
added_org = res1.data;
@@ -118,7 +118,7 @@ describe('adding + deletion with teams still existing (with force)', () => {
expect(res2.headers['content-type']).toContain("application/json")
});
it('delete', async () => {
const res2 = await axios.delete(base + '/api/organisations/' + added_org_id + '?force=true', axios_config);
const res2 = await axios.delete(base + '/api/organizations/' + added_org_id + '?force=true', axios_config);
expect(res2.status).toEqual(200);
expect(res2.headers['content-type']).toContain("application/json")
let added_org2 = res2.data
@@ -139,7 +139,7 @@ describe('adding + deletion with teams still existing (with force)', () => {
});
});
it('check if org really was deleted', async () => {
const res3 = await axios.get(base + '/api/organisations/' + added_org_id, axios_config);
const res3 = await axios.get(base + '/api/organizations/' + added_org_id, axios_config);
expect(res3.status).toEqual(404);
expect(res3.headers['content-type']).toContain("application/json")
});

View File

@@ -14,15 +14,15 @@ beforeAll(async () => {
};
});
describe('GET /api/organisations', () => {
describe('GET /api/organizations', () => {
it('basic get should return 200', async () => {
const res = await axios.get(base + '/api/organisations', axios_config);
const res = await axios.get(base + '/api/organizations', axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
});
});
// ---------------
describe('GET /api/organisations/0', () => {
describe('GET /api/organizations/0', () => {
it('basic get should return 404', async () => {
const res = await axios.get(base + '/api/runners/0', axios_config);
expect(res.status).toEqual(404);

View File

@@ -19,7 +19,7 @@ describe('adding + updating name', () => {
let added_org_id
let added_org
it('creating a new org with just a name should return 200', async () => {
const res = await axios.post(base + '/api/organisations', {
const res = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
added_org = res.data
@@ -28,7 +28,7 @@ describe('adding + updating name', () => {
expect(res.headers['content-type']).toContain("application/json")
});
it('update org', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -59,7 +59,7 @@ describe('adding + try updating id (should return 406)', () => {
let added_org_id
let added_org
it('creating a new org with just a name should return 200', async () => {
const res = await axios.post(base + '/api/organisations', {
const res = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
added_org = res.data
@@ -68,7 +68,7 @@ describe('adding + try updating id (should return 406)', () => {
expect(res.headers['content-type']).toContain("application/json")
});
it('update org', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id + 1,
"name": "testlelele",
"contact": null,
@@ -83,7 +83,7 @@ describe('adding + updateing address valid)', () => {
let added_org_id
let added_org
it('creating a new org with just a name should return 200', async () => {
const res = await axios.post(base + '/api/organisations', {
const res = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
added_org = res.data
@@ -92,7 +92,7 @@ describe('adding + updateing address valid)', () => {
expect(res.headers['content-type']).toContain("application/json")
});
it('adding address to org should return 200', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -122,7 +122,7 @@ describe('adding + updateing address valid)', () => {
});
});
it('updateing address\'s first line should return 200', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -152,7 +152,7 @@ describe('adding + updateing address valid)', () => {
});
});
it('updateing address\'s second line should return 200', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -182,7 +182,7 @@ describe('adding + updateing address valid)', () => {
});
});
it('updateing address\'s city should return 200', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -212,7 +212,7 @@ describe('adding + updateing address valid)', () => {
});
});
it('updateing address\'s country should return 200', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -242,7 +242,7 @@ describe('adding + updateing address valid)', () => {
});
});
it('updateing address\'s postal code should return 200', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -272,7 +272,7 @@ describe('adding + updateing address valid)', () => {
});
});
it('removing org\'s address should return 200', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -300,7 +300,7 @@ describe('adding + updateing address invalid)', () => {
let added_org_id
let added_org
it('creating a new org with just a name should return 200', async () => {
const res = await axios.post(base + '/api/organisations', {
const res = await axios.post(base + '/api/organizations', {
"name": "test123"
}, axios_config);
added_org = res.data
@@ -309,7 +309,7 @@ describe('adding + updateing address invalid)', () => {
expect(res.headers['content-type']).toContain("application/json")
});
it('adding address to org w/o address1 should return 400', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -325,7 +325,7 @@ describe('adding + updateing address invalid)', () => {
expect(res.headers['content-type']).toContain("application/json");
});
it('adding address to org w/o city should return 400', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -341,7 +341,7 @@ describe('adding + updateing address invalid)', () => {
expect(res.headers['content-type']).toContain("application/json");
});
it('adding address to org w/o country should return 400', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -357,7 +357,7 @@ describe('adding + updateing address invalid)', () => {
expect(res.headers['content-type']).toContain("application/json");
});
it('adding address to org w/o postal code should return 400', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,
@@ -373,7 +373,7 @@ describe('adding + updateing address invalid)', () => {
expect(res.headers['content-type']).toContain("application/json");
});
it('adding address to org w/ invalid postal code should return 400', async () => {
const res = await axios.put(base + '/api/organisations/' + added_org_id, {
const res = await axios.put(base + '/api/organizations/' + added_org_id, {
"id": added_org_id,
"name": "testlelele",
"contact": null,