|
|
|
|
|
by mtamizi
4410 days ago
|
|
Here's an example of how we do it: The scenario: https://github.com/balanced/balanced-api/blob/master/feature...: Scenario: Push money to an existing debit card
Given I have sufficient funds in my marketplace
And I have a tokenized debit card
When I POST to /cards/:debit_card_id/credits with the JSON API body:
"""
{
"credits": [{
"amount": 1234
}]
}
"""
Then I should get a 201 Created status code
And the response is valid according to the "credits" schema
And the fields on this credit match:
"""
{
"status": "succeeded"
}
"""
And the credit was successfully created
There's several things in there like "And I have a tokenized debit card" that setup the scenario to be able to do things like "/cards/:debit_card_id/credits", which refers to an actual card ID created in the test API. |
|
For some reason, though, I feel like the natural language would actually intimidate me. Where are ideas like "sufficient funds" defined?