Skip to content

Commit

Permalink
Merge pull request stripe-ruby-mock#435 from rebelidealist/negative-t…
Browse files Browse the repository at this point in the history
…ransfer-amount

added test for negative amount of transfer
  • Loading branch information
alexmamonchik authored May 31, 2017
2 parents b488f2d + 582ea83 commit 8a890ab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/shared_stripe_examples/transfer_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8a890ab

Please sign in to comment.