everyone, I'm trying to check an information from every item of an array but I don't know how to do this for all the 4 items, first that's the standard response:
data: [{"optinId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "description": string", "alertMessage": "string", "master": true, "optin": true}]
this example has only 1 item but the true I have has 4, what I have to do is "expect when MASTER=true then OPTIN=true", I started with a simple IF:
if (response["data"][0]["master"]=true)
expect(@response["data"][0]["optin"]).to eql true
end
that solution isn't enough for me because I want to check all 4 items of the array, can someone please help me with a solution?
try iterating through items in the array, using a for loop or for each
example: