From d3f74b30e1526a9780d58e4e61b1624a76ec2b09 Mon Sep 17 00:00:00 2001 From: Hubert Van De Walle Date: Sat, 25 Apr 2020 18:17:41 +0200 Subject: [PATCH] Update tests --- api/http/test.http | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/api/http/test.http b/api/http/test.http index c32cf85..18e56e1 100644 --- a/api/http/test.http +++ b/api/http/test.http @@ -19,7 +19,43 @@ GET http://localhost:8081/notes Authorization: Bearer {{token}} > {% +client.global.set("uuid", response.body[0].uuid); client.test("Request executed successfully", function() { client.assert(response.status === 200, "Response status is not 200"); }); %} + +### Create note +POST http://localhost:8081/notes +Authorization: Bearer {{token}} +Content-Type: application/json + +{ + "title": "test", + "tags": [ + "Some", + "Tags" + ], + "chapters": [ + { + "title": "Chapter 1", + "content": "# This is some content" + } + ] +} + +> {% +client.test("Request executed successfully", function() { + client.assert(response.status === 201, "Response status is not 201"); +}); +%} + +### Get a note +GET http://localhost:8081/notes/6c4b1524-8cd5-426c-8a07-9a9eb082e9d4 +Authorization: Bearer {{token}} + +> {% +client.test("Request executed successfully", function() { + client.assert(response.status === 200, "Response status is not 200"); +}); +%} \ No newline at end of file