Skip to content

Commit

Permalink
better test
Browse files Browse the repository at this point in the history
  • Loading branch information
helenye-stripe committed Nov 6, 2024
1 parent 252e76f commit edc0ebd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/stripe/request_options_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ class RequestOptionsTest < Test::Unit::TestCase
end

context "combine_opts" do
should "correctly set stripe_version in retrieve" do
Stripe::Account.retrieve("acc_123", stripe_version: "2022-11-15")

assert_requested(
:get,
"#{Stripe.api_base}/v1/accounts/acc_123",
headers: { "Stripe-Version" => "2022-11-15" }
)
should "correctly combine user specified options" do
object_opts = { api_key: "sk_123", stripe_version: "2022-11-15" }
request_opts = { api_key: "sk_456", stripe_account: "acct_123" }
combined = RequestOptions.combine_opts(object_opts, request_opts)
assert_equal(combined[:stripe_version], "2022-11-15")
assert_equal(combined[:api_key], "sk_456")
assert_equal(combined[:stripe_account], "acct_123")
end
end
end
Expand Down

0 comments on commit edc0ebd

Please sign in to comment.