Commit
I made the last scenario mis-understanding the way that the YAML scenarios worked. Often, they have duplicate stuff with new names just to make sure that things work. That means I don't need to translate them 1-1, I have to figure out which thing is actually important and just do that.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,35 @@ | |
@refund_id = @client['refunds']['id'] | ||
@client.add_hydrate :refund_id, @refund_id | ||
end | ||
|
||
When(/^I change the default funding source$/) do | ||
@client.post('/cards', | ||
{ | ||
number: "4111 1111 1111 1111", | ||
expiration_month: 12, | ||
expiration_year: 2016, | ||
} | ||
) | ||
@other_card_id = @client['cards']['id'] | ||
|
||
@client.patch(@customer_url, | ||
[{ | ||
op: "replace", | ||
path: "/customers/0/links/source", | ||
value: @other_card_id | ||
}] | ||
) | ||
end | ||
|
||
When(/^I create a refund$/) do | ||
@original_card_id = @card_id # creating the refund will make a new card | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
steveklabnik
Author
Contributor
|
||
step 'I have created a refund for a debit' | ||
end | ||
|
||
Then(/^the refund should go to the original card$/) do | ||
@client.get(@debit_url) | ||
This comment has been minimized.
Sorry, something went wrong.
mjallday
Contributor
|
||
step "I should get a 200 OK status code" | ||
step 'the response is valid according to the "debits" schema' | ||
step "the fields on these debits match:", %Q/{ "links": { "source": "#{@original_card_id}" } }/ | ||
end | ||
|
?
i'm not sure i grok that comment.