], done)
})
- describe('When making friends', function () {
+ describe('When managing friends', function () {
let userAccessToken = null
before(function (done) {
it('Should fail without public key', function (done) {
const data = {
+ email: 'testexample.com',
host: 'coucou.com'
}
requestsUtils.makePostBodyRequest(server.url, path, null, data, done)
})
+ it('Should fail without an email', function (done) {
+ const data = {
+ host: 'coucou.com',
+ publicKey: 'mysuperpublickey'
+ }
+ requestsUtils.makePostBodyRequest(server.url, path, null, data, done)
+ })
+
+ it('Should fail without an invalid email', function (done) {
+ const data = {
+ host: 'coucou.com',
+ email: 'testexample.com',
+ publicKey: 'mysuperpublickey'
+ }
+ requestsUtils.makePostBodyRequest(server.url, path, null, data, done)
+ })
+
it('Should fail without an host', function (done) {
const data = {
+ email: 'testexample.com',
publicKey: 'mysuperpublickey'
}
requestsUtils.makePostBodyRequest(server.url, path, null, data, done)
it('Should fail with an incorrect host', function (done) {
const data = {
host: 'http://coucou.com',
+ email: 'testexample.com',
publicKey: 'mysuperpublickey'
}
requestsUtils.makePostBodyRequest(server.url, path, null, data, function () {
it('Should succeed with the correct parameters', function (done) {
const data = {
host: 'coucou.com',
+ email: 'test@example.com',
publicKey: 'mysuperpublickey'
}
requestsUtils.makePostBodyRequest(server.url, path, null, data, done, 200)
it('Should fail with a host that already exists', function (done) {
const data = {
host: 'coucou.com',
+ email: 'test@example.com',
publicKey: 'mysuperpublickey'
}
requestsUtils.makePostBodyRequest(server.url, path, null, data, done, 409)