price-point-api/bruno/auth/unauthorized.bru

28 lines
528 B
Text
Raw Permalink Normal View History

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");
});
}