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

37 lines
619 B
Text
Raw Permalink Normal View History

meta {
name: Update Product
type: http
seq: 4
}
patch {
url: {{baseUrl}}/products/{{productId}}
body: json
}
headers {
Content-Type: application/json
Authorization: Bearer {{authToken}}
}
body:json {
{
"product": {
"name": "Updated Product Name"
}
}
}
assert {
res.status: equals 200
}
tests {
test("Update product returns updated object", 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.name).to.equal("Updated Product Name");
});
}