From edc0ebd2af9c609121c461905bfbb4237d3f4cce Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Wed, 6 Nov 2024 15:17:02 -0500 Subject: [PATCH] better test --- test/stripe/request_options_test.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/stripe/request_options_test.rb b/test/stripe/request_options_test.rb index d51c0848d..c9eefb8a5 100644 --- a/test/stripe/request_options_test.rb +++ b/test/stripe/request_options_test.rb @@ -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