mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-08 00:02:46 -04:00
* Rename the `Update` operation to `Save` * Add the `update` class method to all saveable resources * Add tests for update method * Add tests for plans, invoice items, and application fees
22 lines
730 B
Ruby
22 lines
730 B
Ruby
require File.expand_path('../../test_helper', __FILE__)
|
|
|
|
module Stripe
|
|
class RecipientTest < Test::Unit::TestCase
|
|
|
|
should "recipient should be retrievable" do
|
|
@mock.expects(:get).once.returns(make_response(make_recipient))
|
|
r = Stripe::Recipient.retrieve('test_recipient')
|
|
assert_equal 'rp_test_recipient', r.id
|
|
end
|
|
|
|
should "recipient should be updateable" do
|
|
@mock.expects(:post).once.
|
|
with("https://api.stripe.com/v1/recipients/test_recipient", nil, "metadata[foo]=bar").
|
|
returns(make_response(make_recipient(metadata: {foo: 'bar'})))
|
|
r = Stripe::Recipient.update('test_recipient', metadata: {foo: 'bar'})
|
|
assert_equal 'bar', r.metadata['foo']
|
|
end
|
|
end
|
|
end
|
|
|