Merge pull request #3 from RayvarzTech/ContentRangeAndNEQ

Added new tests
This commit is contained in:
2024-10-15 11:22:52 +03:30
committed by GitHub
3 changed files with 39 additions and 2 deletions

View File

@@ -21,4 +21,22 @@ GET /products
test('OK content-range', () => { test('OK content-range', () => {
expect(response.headers['content-range']).to.equal(`0-${itemsCount - 1}/*`); expect(response.headers['content-range']).to.equal(`0-${itemsCount - 1}/*`);
}); });
}} }}
GET /products?offset=3&limit=8&unit_price=lt.14
Prefer: count=exact
?? status == 206
?? header content-range == 3-10/21
GET /products?offset=3&limit=25&unit_price=lt.14
Prefer: count=exact
?? status == 206
?? header content-range == 3-20/21
GET /products?offset=98&unit_price=lt.14
Prefer: count=exact
?? header content-range == */21
GET /products?limit=0&unit_price=lt.14
Prefer: count=exact
?? header content-range == */21

View File

@@ -29,4 +29,13 @@ GET /products?order=product_name.desc
?? js response.parsedBody[0].id == 47 ?? js response.parsedBody[0].id == 47
?? js response.parsedBody[76].id == 17 ?? js response.parsedBody[76].id == 17
?? js response.parsedBody[0].product_name startsWith Z ?? js response.parsedBody[0].product_name startsWith Z
?? js response.parsedBody[76].product_name startsWith A ?? js response.parsedBody[76].product_name startsWith A
###
GET /products?order=id.desc&unit_price=lt.10
?? status == 200
?? js response.parsedBody[0].id == 75
?? js response.parsedBody[10].id == 13
?? js response.parsedBody[0].product_name startsWith R
?? js response.parsedBody[10].product_name startsWith K

View File

@@ -11,6 +11,16 @@ GET /products
?? status == 200 ?? status == 200
?? body length == 77 ?? body length == 77
###
GET /products?discontinued=neq.0
?? status == 200
?? body length == 10
###
GET /products?unit_price=is.null
?? status == 200
?? body length == 0
### ###
POST /products POST /products