tidy up and re-organize

This commit is contained in:
John McLear 2014-11-26 19:28:49 +00:00
parent c0679980bf
commit 5434d2118d
3 changed files with 40 additions and 42 deletions

View File

@ -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

View File

@ -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;
}

View 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;
}