Skip to content

Commit

Permalink
add more test
Browse files Browse the repository at this point in the history
  • Loading branch information
helenye-stripe committed Dec 17, 2024
1 parent 5d86bc8 commit 3d8640d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/stripe/request_params_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ def initialize(games: nil)
assert_equal expected, params.to_h
end

should "convert nested lists" do
params = FooCreateParams.new(
fun: [FooCreateParams::Fun.new(games: "chess"), FooCreateParams::Fun.new(games: "go"), FooCreateParams::Fun.new(games: "sorry")],
team: 42
)
expected = { fun: [{ games: "chess" }, { games: "go" }, { games: "sorry" }], team: 42 }
assert_equal expected, params.to_h
end

should "make request with params class" do
stub_request(:post, "#{Stripe.api_base}/v1/customers")
.with do |req|
Expand Down

0 comments on commit 3d8640d

Please # to comment.