mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
tidy up and re-organize
This commit is contained in:
parent
c0679980bf
commit
5434d2118d
3 changed files with 40 additions and 42 deletions
|
@ -1 +1 @@
|
|||
src/node_modules/mocha/bin/mocha --timeout 5000 --reporter nyan tests/backend/specs
|
||||
src/node_modules/mocha/bin/mocha --timeout 5000 --reporter nyan tests/backend/specs/api
|
||||
|
|
|
@ -4,7 +4,7 @@ var assert = require('assert')
|
|||
api = supertest('http://localhost:9001');
|
||||
path = require('path');
|
||||
|
||||
var filePath = path.join(__dirname, '../../../APIKEY.txt');
|
||||
var filePath = path.join(__dirname, '../../../../APIKEY.txt');
|
||||
|
||||
var apiKey = fs.readFileSync(filePath, {encoding: 'utf-8'});
|
||||
var apiVersion = 1;
|
||||
|
@ -197,46 +197,6 @@ describe('getReadOnlyID', function(){
|
|||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
/* Endpoints Still to interact with..
|
||||
padUsersCount(padID)
|
||||
setPublicStatus(padID, publicStatus)
|
||||
getPublicStatus(padID)
|
||||
setPassword(padID, password)
|
||||
isPasswordProtected(padID)
|
||||
listAuthorsOfPad(padID)
|
||||
getLastEdited(padID)
|
||||
listSessionsOfGroup(groupID)
|
||||
getSessionInfo(sessionID)
|
||||
deleteSession(sessionID)
|
||||
createSession(groupID, authorID, validUntil)
|
||||
listPadsOfAuthor(authorID)
|
||||
createAuthorIfNotExistsFor(authorMapper [, name])
|
||||
createAuthor([name])
|
||||
createGroupPad(groupID, padName [, text])
|
||||
listPads(groupID)
|
||||
deleteGroup(groupID)
|
||||
createGroupIfNotExistsFor(groupMapper)
|
||||
createGroup()
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
describe('getRevisionsCount', function(){
|
||||
it('gets the revision counts of a new pad', function(done) {
|
||||
// This is broken because Etherpad doesn't handle HTTP codes properly see #2$
|
||||
// If your APIKey is password you deserve to fail all tests anyway
|
||||
api.get(endPoint('getRevisionsCount')+"&padID="+testPadId)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(function(res){
|
||||
console.log(res.body);
|
||||
})
|
||||
.expect(200, done)
|
||||
});
|
||||
})
|
||||
*/
|
||||
|
||||
var endPoint = function(point){
|
||||
return '/api/'+apiVersion+'/'+point+'?apikey='+apiKey;
|
||||
}
|
38
tests/backend/specs/api/sessionsAndGroups.js
Normal file
38
tests/backend/specs/api/sessionsAndGroups.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
/* Endpoints Still to interact with..
|
||||
padUsersCount(padID)
|
||||
setPublicStatus(padID, publicStatus)
|
||||
getPublicStatus(padID)
|
||||
setPassword(padID, password)
|
||||
isPasswordProtected(padID)
|
||||
listAuthorsOfPad(padID)
|
||||
getLastEdited(padID)
|
||||
listSessionsOfGroup(groupID)
|
||||
getSessionInfo(sessionID)
|
||||
deleteSession(sessionID)
|
||||
createSession(groupID, authorID, validUntil)
|
||||
listPadsOfAuthor(authorID)
|
||||
createAuthorIfNotExistsFor(authorMapper [, name])
|
||||
createAuthor([name])
|
||||
createGroupPad(groupID, padName [, text])
|
||||
listPads(groupID)
|
||||
deleteGroup(groupID)
|
||||
createGroupIfNotExistsFor(groupMapper)
|
||||
createGroup()
|
||||
*/
|
||||
|
||||
|
||||
var endPoint = function(point){
|
||||
return '/api/'+apiVersion+'/'+point+'?apikey='+apiKey;
|
||||
}
|
||||
|
||||
function makeid()
|
||||
{
|
||||
var text = "";
|
||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for( var i=0; i < 5; i++ ){
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
Loading…
Reference in a new issue