Fix tests

This commit is contained in:
Zoe Roux 2025-04-05 00:33:16 +02:00
parent 6d8697cd9d
commit d88160218b
No known key found for this signature in database
3 changed files with 16 additions and 6 deletions

View File

@ -49,7 +49,7 @@ jobs:
run: |
./keibi > logs &
wget --retry-connrefused --retry-on-http-error=502 http://localhost:4568/health
hurl --variable host=http://localhost:4568 tests/*
hurl --error-format long --variable host=http://localhost:4568 tests/*
env:
POSTGRES_SERVER: localhost

View File

@ -6,13 +6,13 @@ POST {{host}}/sessions
}
HTTP 404
# Invalid password
# Invalid username
POST {{host}}/sessions
{
"login": "invalid-password-user",
"login": "invalid-username-user",
"password": "pass"
}
HTTP 403
HTTP 404
# Me cant be accessed without an account
GET {{host}}/users/me

View File

@ -27,14 +27,15 @@ DELETE {{host}}/sessions/current
Authorization: Bearer {{jwt}}
HTTP 200
POST {{hosts}}/sessions
# Ensure we can login again & /users/me is the same
POST {{host}}/sessions
{
"login": "login-user",
"password": "password-login-user"
}
HTTP 201
[Captures]
jwt: jsonpath "$.token"
token: jsonpath "$.token"
GET {{host}}/jwt
Authorization: Bearer {{token}}
@ -49,6 +50,15 @@ HTTP 200
jsonpath "$.username" == "login-user"
body == {{register_info}}
# Invalid password login
POST {{host}}/sessions
{
"login": "login-user",
"password": "pass-invalid"
}
HTTP 403
DELETE {{host}}/users/me
Authorization: Bearer {{jwt}}
HTTP 200