Skip to content

Commit

Permalink
TicketPlugin under 100 lines
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericHeem committed Mar 18, 2018
1 parent ed0047c commit 9967a9f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions server/src/plugins/ticket/TicketPlugin.js
Expand Up @@ -95,9 +95,4 @@ export default app => {
};

app.server.createRouter(api);

return {
async start() {},
async stop() {}
};
}
};
6 changes: 0 additions & 6 deletions server/src/plugins/ticket/testTicket.js
Expand Up @@ -46,7 +46,6 @@ describe("Ticket", function() {
subject: "Ciao Bella"
};
let ticket = await client.post("v1/ticket", input);
console.log("ticket ", ticket);
assert(ticket);
assert(ticket.user_id);
assert.equal(ticket.subject, input.subject);
Expand All @@ -63,7 +62,6 @@ describe("Ticket", function() {
...inputUpdated,
id: newTicket.id
});
console.log("ticket ", updatedTicket);
assert.equal(updatedTicket.subject, inputUpdated.subject);
});
it("should delete a ticket", async () => {
Expand All @@ -78,13 +76,11 @@ describe("Ticket", function() {
});
it("should get all tickets", async () => {
let tickets = await client.get("v1/ticket");
console.log("tickets ", tickets);
assert(tickets);
assert(Array.isArray(tickets));
});
it("should get one ticket", async () => {
let ticket = await client.get("v1/ticket/1");
console.log("ticket ", ticket);
assert(ticket);
assert(ticket.user_id);
});
Expand All @@ -93,8 +89,6 @@ describe("Ticket", function() {
let tickets = await client.get("v1/ticket/123456");
assert(tickets);
} catch (error) {
//console.log(error.body)
//console.log(error.statusCode)
assert(error.body.error);
assert.equal(error.body.error.name, "NotFound");
assert.equal(error.statusCode, 404);
Expand Down

0 comments on commit 9967a9f

Please sign in to comment.