Updagre tests
This commit is contained in:
@@ -14,6 +14,10 @@ vars:pre-request {
|
||||
id: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -10,6 +10,11 @@ get {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
@@ -11,7 +11,11 @@ get {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id:
|
||||
id: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
|
||||
@@ -11,7 +11,11 @@ get {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id:
|
||||
id: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
meta {
|
||||
name: Search events
|
||||
type: http
|
||||
seq: 7
|
||||
seq: 8
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/events/search?query=vile
|
||||
url: {{url}}/api/events/search
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
@@ -14,6 +14,11 @@ params:query {
|
||||
query: vile
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@ vars:pre-request {
|
||||
description: DADADADADDA
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -21,6 +21,10 @@ vars:pre-request {
|
||||
task_id: 2
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -20,6 +20,10 @@ vars:pre-request {
|
||||
taskId: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
meta {
|
||||
name: Delete task
|
||||
type: http
|
||||
seq: 1
|
||||
seq: 8
|
||||
}
|
||||
|
||||
delete {
|
||||
@@ -14,6 +14,10 @@ vars:pre-request {
|
||||
id: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
meta {
|
||||
name: Is user assigned
|
||||
type: http
|
||||
seq: 9
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/events/tasks/{{id}}/assigned
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /events/tasks/{id}/assigned -- GET
|
||||
|
||||
Vérifie si l'utilisateur connecté est assigné à une tâche spécifique.
|
||||
|
||||
Authentification requise.
|
||||
|
||||
Entrée: id (identifiant de la tâche)
|
||||
}
|
||||
@@ -17,8 +17,12 @@ body:json {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id:
|
||||
task_id:
|
||||
id: 3
|
||||
task_id: 2
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
|
||||
@@ -17,7 +17,11 @@ body:json {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
taskId:
|
||||
taskId: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
|
||||
@@ -22,13 +22,17 @@ body:json {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id:
|
||||
name:
|
||||
description:
|
||||
location:
|
||||
start:
|
||||
end:
|
||||
max_participants:
|
||||
id: 1
|
||||
name: Organisation plage
|
||||
description: il faut organiser la sortie
|
||||
location: La Rochelle
|
||||
start: 2025-01-15T13:45
|
||||
end: 2025-03-15T13:00
|
||||
max_participants: 5
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
|
||||
@@ -32,6 +32,10 @@ vars:pre-request {
|
||||
max_participants: 5
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
meta {
|
||||
name: Export ICS
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/export/ics/{{userId}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
userId: 2398
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.headers.content-type: contains "text/calendar"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /export/ics/{userId} -- GET
|
||||
|
||||
Exporte les tâches d'un utilisateur au format iCalendar (.ics).
|
||||
|
||||
Retourne un fichier téléchargeable agenda_user_{id}.ics.
|
||||
|
||||
Entrée: userId (identifiant de l'utilisateur)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
meta {
|
||||
name: Export
|
||||
seq: 11
|
||||
}
|
||||
|
||||
auth {
|
||||
mode: inherit
|
||||
}
|
||||
@@ -10,6 +10,11 @@ get {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ vars:pre-request {
|
||||
notificationId: 3
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -10,6 +10,10 @@ get {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
meta {
|
||||
name: Read notifications
|
||||
type: http
|
||||
seq: 3
|
||||
seq: 4
|
||||
}
|
||||
|
||||
post {
|
||||
@@ -10,6 +10,11 @@ post {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
meta {
|
||||
name: Delete profile photo
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{url}}/api/profile-photo
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.message: eq "Photo supprimée"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /profile-photo -- DELETE
|
||||
|
||||
Supprime la photo de profil de l'utilisateur connecté.
|
||||
|
||||
Authentification requise.
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
meta {
|
||||
name: Get profile photo
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/profile-photo
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.profile_photo_path: isDefined
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /profile-photo -- GET
|
||||
|
||||
Retourne le chemin de la photo de profil de l'utilisateur connecté.
|
||||
|
||||
Authentification requise.
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
meta {
|
||||
name: Update profile photo
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{url}}/api/profile-photo
|
||||
body: multipartForm
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:multipart-form {
|
||||
photo: @file(photo.jpg)
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.profile_photo_path: isDefined
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /profile-photo -- POST
|
||||
|
||||
Met à jour la photo de profil de l'utilisateur connecté.
|
||||
L'ancienne photo est supprimée si elle existe.
|
||||
|
||||
Authentification requise.
|
||||
|
||||
Entrée: photo (fichier image jpeg/png/jpg/gif, max 2MB)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
meta {
|
||||
name: Profile photo
|
||||
seq: 10
|
||||
}
|
||||
|
||||
auth {
|
||||
mode: inherit
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
meta {
|
||||
name: Create user by admin
|
||||
type: http
|
||||
seq: 13
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{url}}/api/users/create
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "{{name}}",
|
||||
"lastname": "{{lastname}}",
|
||||
"email": "{{email}}",
|
||||
"phone": "{{phone}}"
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
name: Jean
|
||||
lastname: Dupont
|
||||
email: jean.dupont@example.com
|
||||
phone: 0607080910
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.message: eq "User created successfully"
|
||||
res.body.password: isDefined
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/create -- POST
|
||||
|
||||
Permet à un admin de créer un compte utilisateur directement validé.
|
||||
Un mot de passe aléatoire est généré et retourné dans la réponse.
|
||||
|
||||
Authentification requise. L'utilisateur doit être admin.
|
||||
|
||||
Entrées: name, lastname, email, phone
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
meta {
|
||||
name: Deactivate user
|
||||
type: http
|
||||
seq: 14
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{url}}/api/users/{{id}}/deactivate
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id: 13
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.message: eq "User deactivated successfully"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/{id}/deactivate -- POST
|
||||
|
||||
Permet de désactiver le compte d'un utilisateur (validate = 0).
|
||||
|
||||
Authentification requise. L'utilisateur doit être admin.
|
||||
|
||||
Entrée: id (identifiant de l'utilisateur à désactiver)
|
||||
}
|
||||
@@ -14,6 +14,11 @@ vars:pre-request {
|
||||
id: 15
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.message: eq "User deleted successfully"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -10,6 +10,11 @@ delete {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.message: eq "User deleted successfully"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -14,6 +14,10 @@ vars:pre-request {
|
||||
id: 2398
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
meta {
|
||||
name: Get invalid user
|
||||
type: http
|
||||
seq: 11
|
||||
seq: 12
|
||||
}
|
||||
|
||||
get {
|
||||
@@ -10,7 +10,19 @@ get {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/invalid -- GET
|
||||
|
||||
Retourne les IDs des utilisateurs en attente de validation (validate = 0).
|
||||
|
||||
Authentification requise. L'utilisateur doit être admin.
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
meta {
|
||||
name: Get user task by task id
|
||||
type: http
|
||||
seq: 15
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/users/tasks/{{taskId}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
taskId: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.data: isDefined
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/tasks/{idTask} -- GET
|
||||
|
||||
Retourne une tâche spécifique de l'utilisateur connecté par l'ID de la tâche.
|
||||
|
||||
Authentification requise.
|
||||
|
||||
Entrée: taskId (identifiant de la tâche)
|
||||
}
|
||||
@@ -5,16 +5,31 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/users/tasks/{{id}}
|
||||
url: {{url}}/api/users/{{id}}/tasks
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id:
|
||||
id: 2398
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.data: isDefined
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/{id}/tasks -- GET
|
||||
|
||||
Retourne les tâches d'un utilisateur spécifique par son ID.
|
||||
|
||||
Authentification requise.
|
||||
|
||||
Entrée: id (identifiant de l'utilisateur)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,11 @@ get {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.data: isDefined
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/users/search?query=test
|
||||
url: {{url}}/api/users/search
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
@@ -14,6 +14,10 @@ params:query {
|
||||
query: test
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -14,6 +14,11 @@ vars:pre-request {
|
||||
id: 13
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.message: eq "User validated successfully"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -10,6 +10,10 @@ get {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
Reference in New Issue
Block a user