mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add get subscription endpoint
This commit is contained in:
@@ -61,7 +61,7 @@ describe('Test user subscriptions API validators', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('Should success with the correct parameters', async function () {
|
||||
it('Should succeed with the correct parameters', async function () {
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path,
|
||||
@@ -94,7 +94,7 @@ describe('Test user subscriptions API validators', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('Should success with the correct parameters', async function () {
|
||||
it('Should succeed with the correct parameters', async function () {
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path,
|
||||
@@ -140,7 +140,7 @@ describe('Test user subscriptions API validators', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('Should success with the correct parameters', async function () {
|
||||
it('Should succeed with the correct parameters', async function () {
|
||||
await makePostBodyRequest({
|
||||
url: server.url,
|
||||
path,
|
||||
@@ -151,6 +151,57 @@ describe('Test user subscriptions API validators', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('When getting a subscription', function () {
|
||||
it('Should fail with a non authenticated user', async function () {
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path: path + '/user1_channel@localhost:9001',
|
||||
statusCodeExpected: 401
|
||||
})
|
||||
})
|
||||
|
||||
it('Should fail with bad URIs', async function () {
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path: path + '/root',
|
||||
token: server.accessToken,
|
||||
statusCodeExpected: 400
|
||||
})
|
||||
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path: path + '/root@',
|
||||
token: server.accessToken,
|
||||
statusCodeExpected: 400
|
||||
})
|
||||
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path: path + '/root@hello@',
|
||||
token: server.accessToken,
|
||||
statusCodeExpected: 400
|
||||
})
|
||||
})
|
||||
|
||||
it('Should fail with an unknown subscription', async function () {
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path: path + '/root1@localhost:9001',
|
||||
token: server.accessToken,
|
||||
statusCodeExpected: 404
|
||||
})
|
||||
})
|
||||
|
||||
it('Should succeed with the correct parameters', async function () {
|
||||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path: path + '/user1_channel@localhost:9001',
|
||||
token: server.accessToken,
|
||||
statusCodeExpected: 200
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('When removing a subscription', function () {
|
||||
it('Should fail with a non authenticated user', async function () {
|
||||
await makeDeleteRequest({
|
||||
@@ -192,7 +243,7 @@ describe('Test user subscriptions API validators', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('Should success with the correct parameters', async function () {
|
||||
it('Should succeed with the correct parameters', async function () {
|
||||
await makeDeleteRequest({
|
||||
url: server.url,
|
||||
path: path + '/user1_channel@localhost:9001',
|
||||
|
||||
Reference in New Issue
Block a user