mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-08-24 00:00:51 -04:00
Sort encoded parameters for stability in 1.8.7 tests
This commit is contained in:
parent
a48fd12c70
commit
91262c9042
@ -117,7 +117,12 @@ module Stripe
|
||||
result << [calculated_key, value]
|
||||
end
|
||||
end
|
||||
result
|
||||
|
||||
# The #sort_by call here is mostly so that we can get some stability in
|
||||
# our 1.8.7 test suite where Hash key order is not preserved.
|
||||
#
|
||||
# https://www.igvita.com/2009/02/04/ruby-19-internals-ordered-hash/
|
||||
result.sort_by { |(k, _)| k }
|
||||
end
|
||||
|
||||
def self.flatten_params_array(value, calculated_key)
|
||||
|
@ -68,7 +68,7 @@ module Stripe
|
||||
|
||||
@mock.expects(:post).
|
||||
once.
|
||||
with('https://api.stripe.com/v1/accounts/acct_foo', nil, 'legal_entity[first_name]=Bob&legal_entity[address][line1]=2%20Three%20Four').
|
||||
with('https://api.stripe.com/v1/accounts/acct_foo', nil, 'legal_entity[address][line1]=2%20Three%20Four&legal_entity[first_name]=Bob').
|
||||
returns(make_response(resp))
|
||||
|
||||
a = Stripe::Account.retrieve('acct_foo')
|
||||
|
@ -60,7 +60,7 @@ module Stripe
|
||||
|
||||
if is_greater_than_ruby_1_9?
|
||||
check_metadata({:metadata => {:initial => 'true'}},
|
||||
'metadata[uuid]=6735&metadata[initial]=',
|
||||
'metadata[initial]=&metadata[uuid]=6735',
|
||||
update_actions)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user