price-point-api/bruno/stores/create-store.bru
Mohammad Kanaan 13992e1dbe
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
feat: implement user authentication and session management
2026-06-14 14:12:37 +03:00

56 lines
No EOL
1.1 KiB
Text

meta {
name: Create Store
type: http
seq: 2
}
post {
url: {{baseUrl}}/stores
body: json
}
headers {
Content-Type: application/json
Authorization: Bearer {{authToken}}
}
body:json {
{
"store": {
"name": "Test Store Location",
"latitude": 40.7128,
"longitude": -74.006,
"chain_id": {{chainId}}
}
}
}
assert {
res.status: equals 201
}
script:post-response {
const body = res.getBody();
if (body && body.id) {
bru.setVar("storeId", body.id);
}
}
tests {
test("Create store returns store object directly", function() {
const data = res.getBody();
expect(data).to.have.property("id");
expect(data).to.have.property("name");
expect(data).to.have.property("latitude");
expect(data).to.have.property("longitude");
expect(data).to.have.property("chain_id");
expect(data).to.have.property("created_at");
expect(data).to.have.property("updated_at");
});
test("Created store has correct values", function() {
const data = res.getBody();
expect(data.name).to.equal("Test Store Location");
expect(data.chain_id).to.equal(Number(bru.getVar("chainId")));
});
}