forked from mtusi2026/mtusi2026lab2
feat: lab2 done
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
meta {
|
||||
name: Current user
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/v1/users/me
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Bearer {{token}}
|
||||
}
|
||||
|
||||
docs {
|
||||
Бизнес-endpoint требует только Bearer. Basic здесь даёт 401,
|
||||
а заголовок X-User-Id сам по себе доступа не даёт и не подменяет владельца.
|
||||
}
|
||||
|
||||
tests {
|
||||
test("status 200", function() {
|
||||
expect(res.status).to.equal(200);
|
||||
});
|
||||
|
||||
test("это тот же пользователь", function() {
|
||||
expect(res.body.id).to.equal(bru.getVar("userId"));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user