Skip to content

Commit

Permalink
additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
helenye-stripe committed Dec 17, 2024
1 parent 9224e80 commit 78ab765
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/stripe/stripe_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,19 @@ class StripeClientTest < Test::Unit::TestCase
assert_equal obj.id, "acc_123"
end

should "allow refresh on deserialized object" do
expected_body = "{\"id\": \"acc_123\", \"object\": \"account\"}"

stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v1/accounts/acc_123")
.to_return(status: 200, body: expected_body)

obj = @client.deserialize(expected_body)
obj = obj.refresh

assert_equal obj.class, Stripe::Account
assert_equal obj.id, "acc_123"
end

should "deserializes hash into unknown object" do
expected_body = { "id" => "acc_123", "object" => "unknown" }

Expand Down

0 comments on commit 78ab765

Please sign in to comment.