diff --git a/features/push_to_card.feature b/features/push_to_card.feature index e56f74c..c415e17 100644 --- a/features/push_to_card.feature +++ b/features/push_to_card.feature @@ -197,9 +197,40 @@ Feature: Push to card When I make a POST request to the link "credits.reversals" Then I should get a 201 Created status code And the response is valid according to the "reversals" schema - And the fields on this credit match: + And the fields on this reversal match: """ { "status": "succeeded" } """ + +Scenario: Reverse a pending credit to a debit card + The debit card number "4210101111111112" is a special card number + + Given I have sufficient funds in my marketplace + When I POST to /cards with the JSON API body: + """ + { + "cards": [{ + "name": "George Handel", + "number": "4210101111111112", + "expiration_month": "05", + "expiration_year": "2017" + }] + } + """ + And the fields on this credit match: + """ + { + "status": "pending" + } + """ + And I POST to "credits.reversals" + Then I should get a 201 Created status code + And the response is valid according to the "reversals" schema + And the fields on this reversal match: + """ + { + "status": "succeeded" + } + """