From b9e1c9d68cde5754cecb7561611d9b3593408229 Mon Sep 17 00:00:00 2001 From: AmirTk Date: Sat, 9 Sep 2023 11:04:20 +0000 Subject: [PATCH 1/2] Writing tests for ordering based on id and name --- Ordering.http | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Ordering.http diff --git a/Ordering.http b/Ordering.http new file mode 100644 index 0000000..59b3256 --- /dev/null +++ b/Ordering.http @@ -0,0 +1,26 @@ +GET {{baseUrl}}/products?order=id.desc +?? status == 200 +?? js response.parsedBody[0].id == 77 +?? js response.parsedBody[76].id == 1 +### + +GET {{baseUrl}}/products?order=id.asc +?? status == 200 +?? js response.parsedBody[0].id == 1 +?? js response.parsedBody[76].id == 77 + +### +GET {{baseUrl}}/products?order=product_name.asc +?? status == 200 +?? js response.parsedBody[0].id == 17 +?? js response.parsedBody[76].id == 47 +?? js response.parsedBody[0].product_name startsWith A +?? js response.parsedBody[76].product_name startsWith Z + +### + GET {{baseUrl}}/products?order=product_name.desc +?? status == 200 +?? js response.parsedBody[0].id == 47 +?? js response.parsedBody[76].id == 17 +?? js response.parsedBody[0].product_name startsWith Z +?? js response.parsedBody[76].product_name startsWith A \ No newline at end of file From 1d1930f7631bfd10b4e31794c7f456a1d4e6c209 Mon Sep 17 00:00:00 2001 From: AmirTk Date: Sat, 9 Sep 2023 13:01:28 +0000 Subject: [PATCH 2/2] Remove asc from query in order to test default act --- Ordering.http | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ordering.http b/Ordering.http index 59b3256..74a31b9 100644 --- a/Ordering.http +++ b/Ordering.http @@ -4,7 +4,7 @@ GET {{baseUrl}}/products?order=id.desc ?? js response.parsedBody[76].id == 1 ### -GET {{baseUrl}}/products?order=id.asc +GET {{baseUrl}}/products?order=id ?? status == 200 ?? js response.parsedBody[0].id == 1 ?? js response.parsedBody[76].id == 77