From 1647c43e0e9beed35086e31e334081ce9dbf1464 Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 27 Jan 2021 19:07:09 +0100 Subject: [PATCH] test cases for #744 --- .../001_records/090_add_multiple_comments.log | 26 ++++++++++++++ .../091_edit_multiple_comments.log | 36 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 tests/functional/001_records/090_add_multiple_comments.log create mode 100644 tests/functional/001_records/091_edit_multiple_comments.log diff --git a/tests/functional/001_records/090_add_multiple_comments.log b/tests/functional/001_records/090_add_multiple_comments.log new file mode 100644 index 0000000..f62cc6f --- /dev/null +++ b/tests/functional/001_records/090_add_multiple_comments.log @@ -0,0 +1,26 @@ +=== +POST /records/comments + +[{"user_id":1,"post_id":6,"message":"multi 1","category_id":3},{"user_id":1,"post_id":6,"message":"multi 2","category_id":3}] +=== +200 +Content-Type: application/json; charset=utf-8 +Content-Length: 5 + +[7,8] +=== +GET /records/comments?include=id&filter=post_id,eq,6 +=== +200 +Content-Type: application/json; charset=utf-8 +Content-Length: 31 + +{"records":[{"id":7},{"id":8}]} +=== +POST /records/comments + +[{"user_id":1,"post_id":6,"message":"multi 3","category_id":3},{"user_id":1,"post_id":0,"message":"multi 4","category_id":3}] +=== +=== +GET /records/comments?include=id&filter=post_id,eq,6 +=== diff --git a/tests/functional/001_records/091_edit_multiple_comments.log b/tests/functional/001_records/091_edit_multiple_comments.log new file mode 100644 index 0000000..2e6cbc6 --- /dev/null +++ b/tests/functional/001_records/091_edit_multiple_comments.log @@ -0,0 +1,36 @@ +=== +PUT /records/comments/7,8 + +[{"user_id":1,"post_id":6,"message":"multi 1","category_id":3},{"user_id":1,"post_id":6,"message":"multi 2","category_id":3}] +=== +200 +Content-Type: application/json; charset=utf-8 +Content-Length: 5 + +[1,1] +=== +GET /records/comments?include=id&filter=post_id,eq,6 +=== +200 +Content-Type: application/json; charset=utf-8 +Content-Length: 31 + +{"records":[{"id":7},{"id":8}]} +=== +PUT /records/comments/7,8 + +[{"user_id":1,"post_id":6,"message":"multi 3","category_id":3},{"user_id":1,"post_id":0,"message":"multi 4","category_id":3}] +=== +200 +Content-Type: application/json; charset=utf-8 +Content-Length: 5 + +[0,0] +=== +GET /records/comments?include=message&filter=post_id,eq,6 +=== +200 +Content-Type: application/json; charset=utf-8 +Content-Length: 14 + +{"records":[]}