]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
urls: makefriends/quitfriends -> make-friends/quit-friends
authorChocobozzz <florian.bigard@gmail.com>
Thu, 7 Sep 2017 19:22:17 +0000 (21:22 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Thu, 7 Sep 2017 19:22:17 +0000 (21:22 +0200)
client/src/app/+admin/friends/shared/friend.service.ts
server/controllers/api/pods.ts
server/tests/api/check-params/pods.ts
server/tests/utils/pods.ts

index 8bc0239ab9a62d49521921f5762d0df1521afc1b..9b3ff04b197cc48025f40e9f1bde84b9d936a706 100644 (file)
@@ -26,13 +26,13 @@ export class FriendService {
       hosts: notEmptyHosts
     }
 
-    return this.authHttp.post(FriendService.BASE_FRIEND_URL + 'makefriends', body)
+    return this.authHttp.post(FriendService.BASE_FRIEND_URL + 'make-friends', body)
                         .map(this.restExtractor.extractDataBool)
                         .catch((res) => this.restExtractor.handleError(res))
   }
 
   quitFriends () {
-    return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'quitfriends')
+    return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'quit-friends')
                         .map(res => res.status)
                         .catch((res) => this.restExtractor.handleError(res))
   }
index e1fa4b7e8b1d67c597b1f69bf3bb144ba694d102..e1e8ff6cad51abf5f2f7940ae876ba68b2ae5fd2 100644 (file)
@@ -35,14 +35,14 @@ podsRouter.post('/',
   podsAddValidator,
   addPods
 )
-podsRouter.post('/makefriends',
+podsRouter.post('/make-friends',
   authenticate,
   ensureIsAdmin,
   makeFriendsValidator,
   setBodyHostsPort,
   makeFriendsController
 )
-podsRouter.get('/quitfriends',
+podsRouter.get('/quit-friends',
   authenticate,
   ensureIsAdmin,
   quitFriendsController
index 27c080931b958d4cb10412f9be5ec5ba2296f959..a897e4dcd959801e509b36442a2f7604460417ba 100644 (file)
@@ -49,7 +49,7 @@ describe('Test pods API validators', function () {
 
       it('Should fail without hosts', async function () {
         await request(server.url)
-                .post(path + '/makefriends')
+                .post(path + '/make-friends')
                 .set('Authorization', 'Bearer ' + server.accessToken)
                 .set('Accept', 'application/json')
                 .expect(400)
@@ -57,7 +57,7 @@ describe('Test pods API validators', function () {
 
       it('Should fail if hosts is not an array', async function () {
         await request(server.url)
-                .post(path + '/makefriends')
+                .post(path + '/make-friends')
                 .send({ hosts: 'localhost:9002' })
                 .set('Authorization', 'Bearer ' + server.accessToken)
                 .set('Accept', 'application/json')
@@ -66,7 +66,7 @@ describe('Test pods API validators', function () {
 
       it('Should fail if the array is not composed by hosts', async function () {
         await request(server.url)
-                .post(path + '/makefriends')
+                .post(path + '/make-friends')
                 .send({ hosts: [ 'localhost:9002', 'localhost:coucou' ] })
                 .set('Authorization', 'Bearer ' + server.accessToken)
                 .set('Accept', 'application/json')
@@ -75,7 +75,7 @@ describe('Test pods API validators', function () {
 
       it('Should fail if the array is composed with http schemes', async function () {
         await request(server.url)
-                .post(path + '/makefriends')
+                .post(path + '/make-friends')
                 .send({ hosts: [ 'localhost:9002', 'http://localhost:9003' ] })
                 .set('Authorization', 'Bearer ' + server.accessToken)
                 .set('Accept', 'application/json')
@@ -84,7 +84,7 @@ describe('Test pods API validators', function () {
 
       it('Should fail if hosts are not unique', async function () {
         await request(server.url)
-                .post(path + '/makefriends')
+                .post(path + '/make-friends')
                 .send({ urls: [ 'localhost:9002', 'localhost:9002' ] })
                 .set('Authorization', 'Bearer ' + server.accessToken)
                 .set('Accept', 'application/json')
@@ -93,16 +93,16 @@ describe('Test pods API validators', function () {
 
       it('Should fail with an invalid token', async function () {
         await request(server.url)
-                .post(path + '/makefriends')
+                .post(path + '/make-friends')
                 .send(body)
-                .set('Authorization', 'Bearer faketoken')
+                .set('Authorization', 'Bearer fake_token')
                 .set('Accept', 'application/json')
                 .expect(401)
       })
 
       it('Should fail if the user is not an administrator', async function () {
         await request(server.url)
-                .post(path + '/makefriends')
+                .post(path + '/make-friends')
                 .send(body)
                 .set('Authorization', 'Bearer ' + userAccessToken)
                 .set('Accept', 'application/json')
@@ -113,7 +113,7 @@ describe('Test pods API validators', function () {
     describe('When quitting friends', function () {
       it('Should fail with an invalid token', async function () {
         await request(server.url)
-                .get(path + '/quitfriends')
+                .get(path + '/quit-friends')
                 .query({ start: 'hello' })
                 .set('Authorization', 'Bearer faketoken')
                 .set('Accept', 'application/json')
@@ -122,7 +122,7 @@ describe('Test pods API validators', function () {
 
       it('Should fail if the user is not an administrator', async function () {
         await request(server.url)
-                .get(path + '/quitfriends')
+                .get(path + '/quit-friends')
                 .query({ start: 'hello' })
                 .set('Authorization', 'Bearer ' + userAccessToken)
                 .set('Accept', 'application/json')
index 0bea6db9782f8a73a636f49c5991facecc44d555..a86dd20d912cd12e3aea1cfafbcd5849264c85e3 100644 (file)
@@ -37,7 +37,7 @@ async function makeFriends (url: string, accessToken: string, expectedStatus = 2
       'localhost:9003'
     ]
   }
-  const path = '/api/v1/pods/makefriends'
+  const path = '/api/v1/pods/make-friends'
 
   // The first pod make friend with the third
   const res = await request(url)
@@ -54,7 +54,7 @@ async function makeFriends (url: string, accessToken: string, expectedStatus = 2
 }
 
 async function quitFriends (url: string, accessToken: string, expectedStatus = 204) {
-  const path = '/api/v1/pods/quitfriends'
+  const path = '/api/v1/pods/quit-friends'
 
   // The first pod make friend with the third
   const res = await request(url)