mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -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
21 lines
581 B
Ruby
21 lines
581 B
Ruby
# -*- coding: utf-8 -*-
|
|
require File.expand_path('../../test_helper', __FILE__)
|
|
|
|
module Stripe
|
|
class ApiOperationsTest < Test::Unit::TestCase
|
|
class Updater < APIResource
|
|
include Stripe::APIOperations::Save
|
|
end
|
|
|
|
should "the Update API operation should post the correct parameters to the resource URL" do
|
|
@mock.expects(:post).once.
|
|
with("#{Stripe.api_base}/v1/updaters/id", nil, 'foo=bar').
|
|
returns(make_response({foo: 'bar'}))
|
|
resource = Updater::update("id", {foo: "bar"})
|
|
assert_equal('bar', resource.foo)
|
|
end
|
|
end
|
|
end
|
|
|
|
|