forked from mtusi2026/mtusi2026lab2
41 lines
848 B
Plaintext
41 lines
848 B
Plaintext
meta {
|
|
name: Send message as second user
|
|
type: http
|
|
seq: 2
|
|
}
|
|
|
|
post {
|
|
url: {{baseUrl}}/api/v1/chats/{{chatId}}/messages
|
|
body: json
|
|
auth: none
|
|
}
|
|
|
|
headers {
|
|
Authorization: Bearer {{secondToken}}
|
|
}
|
|
|
|
docs {
|
|
Любой участник чата может писать. Второе сообщение нужно, чтобы
|
|
страница с limit=1 вернула next_cursor и пагинацию можно было проверить.
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"text": "Ответ второго участника"
|
|
}
|
|
}
|
|
|
|
tests {
|
|
test("201 created", function() {
|
|
expect(res.status).to.equal(201);
|
|
});
|
|
|
|
test("sender — второй пользователь", function() {
|
|
expect(res.body.sender_id).to.equal(bru.getVar("secondUserId"));
|
|
});
|
|
}
|
|
|
|
script:post-response {
|
|
bru.setVar("secondMessageId", res.body.id);
|
|
}
|