forked from mtusi2026/mtusi2026lab2
32 lines
741 B
Plaintext
32 lines
741 B
Plaintext
meta {
|
|
name: Invalid limit and cursor
|
|
type: http
|
|
seq: 6
|
|
}
|
|
|
|
get {
|
|
url: {{baseUrl}}/api/v1/chats/{{chatId}}/messages?limit=101&cursor=not-a-cursor
|
|
body: none
|
|
auth: none
|
|
}
|
|
|
|
headers {
|
|
Authorization: Bearer {{token}}
|
|
}
|
|
|
|
docs {
|
|
limit вне 1..100 и неизвестный cursor — 400 invalid_request,
|
|
в одном формате ошибки с request_id, совпадающим с заголовком.
|
|
}
|
|
|
|
tests {
|
|
test("400 invalid_request", function() {
|
|
expect(res.status).to.equal(400);
|
|
});
|
|
|
|
test("формат ошибки по контракту", function() {
|
|
expect(res.body.error.code).to.equal("invalid_request");
|
|
expect(res.body.error.request_id).to.equal(res.headers["x-request-id"]);
|
|
});
|
|
}
|