mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 00:15:13 -04:00
use before and after hooks
This commit is contained in:
parent
70a513749a
commit
e8f46eba5d
1 changed files with 15 additions and 11 deletions
|
@ -16,35 +16,39 @@ describe(__filename, function () {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
let backup;
|
||||||
|
|
||||||
before(async function () { agent = await common.init(); });
|
before(async function () {
|
||||||
|
backup = settings.lowerCasePadIds;
|
||||||
|
agent = await common.init();
|
||||||
|
});
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await cleanUpPads();
|
await cleanUpPads();
|
||||||
});
|
});
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
await cleanUpPads();
|
await cleanUpPads();
|
||||||
});
|
});
|
||||||
|
after(async function () {
|
||||||
|
settings.lowerCasePadIds = backup;
|
||||||
|
});
|
||||||
|
|
||||||
describe('not activated', function () {
|
describe('not activated', function () {
|
||||||
Object.assign(settings, {
|
beforeEach(async function () {
|
||||||
lowerCasePadIds: false,
|
settings.lowerCasePadIds = false;
|
||||||
});
|
|
||||||
it('- do nothing', async function () {
|
|
||||||
const res = await agent.get('/p/UPPERCASEpad');
|
|
||||||
assert.equal(res.status, 200);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('- do nothingg', async function () {
|
|
||||||
|
it('- do nothing', async function () {
|
||||||
await agent.get('/p/UPPERCASEpad')
|
await agent.get('/p/UPPERCASEpad')
|
||||||
.expect(200);
|
.expect(200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('activated', function () {
|
describe('activated', function () {
|
||||||
it('- lowercase pad ids', async function () {
|
beforeEach(async function () {
|
||||||
Object.assign(settings, {
|
settings.lowerCasePadIds = true;
|
||||||
lowerCasePadIds: true,
|
|
||||||
});
|
});
|
||||||
|
it('- lowercase pad ids', async function () {
|
||||||
await agent.get('/p/UPPERCASEpad')
|
await agent.get('/p/UPPERCASEpad')
|
||||||
.expect(302)
|
.expect(302)
|
||||||
.expect('location', 'uppercasepad');
|
.expect('location', 'uppercasepad');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue