28 lines
No EOL
528 B
Text
28 lines
No EOL
528 B
Text
meta {
|
|
name: Unauthorized Access
|
|
type: http
|
|
seq: 5
|
|
}
|
|
|
|
get {
|
|
url: {{baseUrl}}/users/{{userId}}
|
|
}
|
|
|
|
headers {
|
|
Authorization: Bearer invalid_token_here
|
|
}
|
|
|
|
assert {
|
|
res.status: equals 401
|
|
res.body.success: equals false
|
|
}
|
|
|
|
tests {
|
|
test("Invalid token returns 401 with error shape", function() {
|
|
const data = res.getBody();
|
|
expect(data).to.have.property("success");
|
|
expect(data.success).to.equal(false);
|
|
expect(data).to.have.property("error");
|
|
expect(data.error).to.have.property("message");
|
|
});
|
|
} |