Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check multi dimensional arrays? #13

Closed
dzschille opened this issue Oct 10, 2016 · 2 comments
Closed

How to check multi dimensional arrays? #13

dzschille opened this issue Oct 10, 2016 · 2 comments
Assignees
Labels

Comments

@dzschille
Copy link

I have an response body like this:

{
    "customer":{
        "id":"12345",
        "name":"Behat Testing API",
        "images":[{
            "id":"5678",
            "filename_client":"tech.ai",
            "filename_preview":"testimage-converted.png",
            "filename_print":"testimage.ai",
            "url":"\/media\/testimage-converted.png",
            "created_time":"2016-10-10 07:28:42"
        },
        {
            "id":"7890",
            "filename_client":"demo.ai",
            "filename_preview":"demoimage-converted.png",
            "filename_print":"demoimage.ai",
            "url":"\/media\/demoimage-converted.png",
            "created_time":"2016-10-10 07:38:22"
        }]
    }
}

And i want to check if "filename_client" == "tech.ai", so i use

Then the response body contains:
      """
        {
          "customer": {
            "images[0]": {
              "filename_client": "tech.ai"
            }
          }
        }
      """

This doesn't work. What am i doing wrong?

@christeredvartsen christeredvartsen self-assigned this Oct 11, 2016
christeredvartsen added a commit that referenced this issue Oct 11, 2016
* Add route that returns an array as specified in issue #13
* Add tests that validates the issue
* Fix issue
* Split up the two test scripts and refer to them in the combined script
* Update ChangeLog
@christeredvartsen
Copy link
Member

Could you please try to upgrade to 1.0-dev and see if that helps? I have added a couple of test cases using your haystack and needle, and it should work as expected now.

@dzschille
Copy link
Author

Works great, thanks for the quick fix!
Also the message in case of a mismatch is nice.

btw: i tested with "1.0.x-dev".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants