-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merges branch 'devel' of github.com:fga-eps-mds/2021.1-Oraculo…
…-Registros into devel
- Loading branch information
Showing
2 changed files
with
32 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ const validRecord1 = { | |
receipt_form: "form", | ||
contact_info: "[email protected]", | ||
created_by: "[email protected]", | ||
tags: [] | ||
}; | ||
|
||
const validRecord2 = { | ||
|
@@ -29,6 +30,7 @@ const validRecord2 = { | |
contact_info: "[email protected]", | ||
situation: 2, | ||
created_by: "[email protected]", | ||
tags: [] | ||
}; | ||
|
||
const invalidRecord1 = { | ||
|
@@ -102,7 +104,10 @@ describe("Main test", () => { | |
const res1 = await request(app).post("/records").send(validRecord1); | ||
expect(res1.statusCode).toEqual(200); | ||
|
||
const res = await request(app).get("/records/1/tags"); | ||
const res2 = await request(app).post(`/records/${res1.body.id}/add-tag`).send({ tag_id: 1 }); | ||
expect(res2.statusCode).toEqual(200); | ||
|
||
const res = await request(app).get(`/records/${res1.body.id}/tags`); | ||
expect(res.statusCode).toEqual(200); | ||
}); | ||
|
||
|
@@ -322,7 +327,7 @@ describe("Main test", () => { | |
expect(res.body.message).toBeDefined(); | ||
}); | ||
|
||
it("GET /records/1/tags - should list tags of a record (empty tags)", async () => { | ||
it("GET /records/:id/tags - should list tags of a record (empty tags)", async () => { | ||
const res = await request(app).get("/records/1/tags"); | ||
expect(res.statusCode).toEqual(200); | ||
}); | ||
|
@@ -354,7 +359,7 @@ describe("Main test", () => { | |
it("POST /records/:id/edit - should edit a record", async () => { | ||
const res = await request(app) | ||
.post("/records/1/edit") | ||
.send({ city: "Goiania" }); | ||
.send({ city: "Goiania", tags: [] }); | ||
expect(res.statusCode).toEqual(200); | ||
expect(res.body).toBeDefined(); | ||
}); | ||
|