meta { name: "Test Collection Rules" type: http seq: 1 } post { url: {{baseUrl}}/api/collections/test-rules body: { rules: [ { field: "genre", operator: "equals", value: "Science Fiction" } ] } assert { res.status: 200 res.body.matches: #array res.body.total: #number } } post { url: {{baseUrl}}/api/collections/test-rules body: { rules: [ { field: "author", operator: "contains", value: "Asimov" } ] } assert { res.status: 200 res.body.matches: #array } } post { url: {{baseUrl}}/api/collections/test-rules body: { rules: [ { field: "copyright_year", operator: "greater_than", value: "2000" } ] } assert { res.status: 200 } } post { url: {{baseUrl}}/api/collections/test-rules body: { rules: [ { field: "genre", operator: "equals", value: "NonExistentGenre123456" } ] } assert { res.status: 200 res.body.total: 0 } } post { url: {{baseUrl}}/api/collections/test-rules body: { rules: [] } assert { res.status: 400 } }