Skip to content

Commit 04d7584

Browse files
committed
Merge branch '278-testcases-for-assignment' of https://github.com/tcet-opensource/erp-backend into 279-assignment-apidoc
2 parents a6e84f1 + ec07e81 commit 04d7584

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

controller/assignment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function addAssignment(req, res) {
99
} = req.body;
1010
try {
1111
const newAssignment = await createAssignment(no, title, type, marks);
12-
res.json({ res: `added user ${newAssignment.id}`, id: newAssignment.id });
12+
res.json({ res: `added assignment ${newAssignment.id}`, id: newAssignment.id });
1313
} catch (error) {
1414
logger.error("Error while inserting", error);
1515
res.status(500);
@@ -24,7 +24,7 @@ async function updateAssignment(req, res) {
2424
} = req.body;
2525
try {
2626
await updateAssignmentById(id, data);
27-
res.json({ res: `updated assignment with id ${id}` });
27+
res.json({ res: `updated assignment ${id}` });
2828
} catch (error) {
2929
logger.error("Error while updating", error);
3030
res.status(500);

test/routes/assignment.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ describe("checking assignment functions", () => {
7373
.send({ no: "123" }, { no: "345" });
7474
expect(response.headers["content-type"]).toMatch(/json/);
7575
expect(response.status).toBe(200);
76-
expect(response.body.res).toMatch(/assignment updated/);
76+
expect(response.body.res).toMatch(/updated assignment/);
7777
});
7878
});

0 commit comments

Comments
 (0)