forked from mtusi2026/mtusi2026lab2
feat: lab2 done
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
meta {
|
||||
name: Duplicate username returns 409
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/v1/users
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
docs {
|
||||
Повторная регистрация того же username. Уникальность обеспечивает
|
||||
unique-индекс PostgreSQL, ошибка 23505 маппится в 409 (не 500).
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"username": "{{username}}",
|
||||
"display_name": "Дубликат",
|
||||
"password": "{{password}}"
|
||||
}
|
||||
}
|
||||
|
||||
tests {
|
||||
test("409 conflict", function() {
|
||||
expect(res.status).to.equal(409);
|
||||
});
|
||||
|
||||
test("код ошибки conflict", function() {
|
||||
expect(res.body.error.code).to.equal("conflict");
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user