mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-28 11:26:16 -04:00
add tests from origin/develop
This commit is contained in:
parent
6a3e4c69b8
commit
2df2d7d60a
71 changed files with 18931 additions and 4032 deletions
38
tests/container/specs/api/pad.js
Normal file
38
tests/container/specs/api/pad.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* ACHTUNG: this file was copied & modified from the analogous
|
||||
* <basedir>/tests/backend/specs/api/pad.js
|
||||
*
|
||||
* TODO: unify those two files, and merge in a single one.
|
||||
*/
|
||||
|
||||
const supertest = require(__dirname+'/../../../../src/node_modules/supertest');
|
||||
const settings = require(__dirname+'/../../loadSettings').loadSettings();
|
||||
const api = supertest('http://'+settings.ip+":"+settings.port);
|
||||
|
||||
var apiVersion = 1;
|
||||
|
||||
describe('Connectivity', function(){
|
||||
it('can connect', function(done) {
|
||||
api.get('/api/')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200, done)
|
||||
});
|
||||
})
|
||||
|
||||
describe('API Versioning', function(){
|
||||
it('finds the version tag', function(done) {
|
||||
api.get('/api/')
|
||||
.expect(function(res){
|
||||
if (!res.body.currentVersion) throw new Error("No version set in API");
|
||||
return;
|
||||
})
|
||||
.expect(200, done)
|
||||
});
|
||||
})
|
||||
|
||||
describe('Permission', function(){
|
||||
it('errors with invalid APIKey', function(done) {
|
||||
api.get('/api/'+apiVersion+'/createPad?apikey=wrong_password&padID=test')
|
||||
.expect(401, done)
|
||||
});
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue