forked from stripe-ruby-mock/stripe-ruby-mock
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request stripe-ruby-mock#435 from rebelidealist/negative-t…
…ransfer-amount added test for negative amount of transfer
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,4 +78,20 @@ | |
expect(e.http_status).to eq(400) | ||
} | ||
end | ||
|
||
it 'when amount is negative', focus: true, live: true do | ||
rec = Stripe::Recipient.create({ | ||
type: 'individual', | ||
name: 'Alex Smith', | ||
}) | ||
expect { Stripe::Transfer.create(amount: '-400', | ||
currency: 'usd', | ||
recipient: rec.id, | ||
description: 'Transfer for [email protected]') }.to raise_error { |e| | ||
expect(e).to be_a Stripe::InvalidRequestError | ||
expect(e.param).to eq('amount') | ||
expect(e.message).to match(/^Invalid.*integer/) | ||
expect(e.http_status).to eq(400) | ||
} | ||
end | ||
end |