price-point-api/bruno/products/get-product.bru

33 lines
690 B
Text
Raw Normal View History

meta {
name: Get Product
type: http
seq: 3
}
get {
url: {{baseUrl}}/products/{{productId}}
}
headers {
Authorization: Bearer {{authToken}}
}
assert {
res.status: equals 200
}
tests {
test("Get product returns product object directly", function() {
const data = res.getBody();
expect(data).to.have.property("id");
expect(data).to.have.property("name");
expect(data).to.have.property("barcode");
expect(data).to.have.property("created_at");
expect(data).to.have.property("updated_at");
});
test("Product id matches requested id", function() {
const data = res.getBody();
expect(data.id).to.equal(Number(bru.getVar("productId")));
});
}