summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2014-11-26 19:28:49 +0000
committerJohn McLear <john@mclear.co.uk>2014-11-26 19:28:49 +0000
commit5434d2118d9b6828f3c679f88618ee8403fd6e8b (patch)
treee0d50bb897d70da5677c7bedac3ef5e455e2a6f5 /tests
parentc0679980bf383ce452431feb7020c91d6c4ee43b (diff)
downloadetherpad-lite-5434d2118d9b6828f3c679f88618ee8403fd6e8b.zip
tidy up and re-organize
Diffstat (limited to 'tests')
-rw-r--r--tests/backend/specs/api/pad.js (renamed from tests/backend/specs/api.js)42
-rw-r--r--tests/backend/specs/api/sessionsAndGroups.js38
2 files changed, 39 insertions, 41 deletions
diff --git a/tests/backend/specs/api.js b/tests/backend/specs/api/pad.js
index 279f3088..efb3f6de 100644
--- a/tests/backend/specs/api.js
+++ b/tests/backend/specs/api/pad.js
@@ -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;
}
diff --git a/tests/backend/specs/api/sessionsAndGroups.js b/tests/backend/specs/api/sessionsAndGroups.js
new file mode 100644
index 00000000..921724c7
--- /dev/null
+++ b/tests/backend/specs/api/sessionsAndGroups.js
@@ -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;
+}
+