Files
mtusi2026lab2/bruno/negative/wrong-password.bru
T
2026-10-09 15:48:03 +03:00

36 lines
839 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
meta {
name: Wrong password
type: http
seq: 1
}
post {
url: {{baseUrl}}/api/v1/auth/sessions
body: none
auth: basic
}
auth:basic {
username: {{username}}
password: definitely-wrong-password
}
docs {
Неверный пароль: 401 без раскрытия, существует ли пользователь,
и с тем же Basic-challenge, что и при неизвестном пользователе.
}
tests {
test("401 unauthorized", function() {
expect(res.status).to.equal(401);
});
test("Basic challenge", function() {
expect(res.headers["www-authenticate"]).to.equal('Basic realm="messenger", charset="UTF-8"');
});
test("request_id совпадает с заголовком", function() {
expect(res.body.error.request_id).to.equal(res.headers["x-request-id"]);
});
}