Wednesday, 21 August 2013

Which is the MongoDB EmbeddedCollection representation in Behat TableNodes

Which is the MongoDB EmbeddedCollection representation in Behat TableNodes

I am trying to write a Behat feature for a subresource of my API Rest. The
underlaying data model is MongoDB and the test consist about testing the
address subresource of the user resource.
Given the Address subresource is a EmbeddedDocument inside the User
Document I would have something like this in json format:
{
"username":"admin"
"email":"admin@admin.com",
"addresses":[
{
"country":"IT",
"city":"Roma",
},
{
"country":"ES",
"city":"Madrid",
}
]
}
What I am trying to do is write a Given Step as a fixture fo the test.
Something like this:
Given the following API users exist:
| username | email | addresses[] |
| rick | admin@admin.com | ??????????????????? |
How can I represent such json data in a Gherkin Table?
Thanks!!

No comments:

Post a Comment