mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-07 00:05:33 -04:00
Add spec for #dirty!
This commit is contained in:
parent
f723080220
commit
fcfef21c77
@ -258,5 +258,19 @@ module Stripe
|
|||||||
serialized = Stripe::StripeObject.serialize_params(obj, :force => true)
|
serialized = Stripe::StripeObject.serialize_params(obj, :force => true)
|
||||||
assert_equal({ :id => 'id', :metadata => { :foo => 'bar' } }, serialized)
|
assert_equal({ :id => 'id', :metadata => { :foo => 'bar' } }, serialized)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "#dirty! forces an object and its subobjects to be saved" do
|
||||||
|
obj = Stripe::StripeObject.construct_from({
|
||||||
|
:id => 'id',
|
||||||
|
:metadata => Stripe::StripeObject.construct_from({ :foo => 'bar' })
|
||||||
|
})
|
||||||
|
|
||||||
|
# note that `force` and `dirty!` are for different things, but are
|
||||||
|
# functionally equivalent
|
||||||
|
obj.dirty!
|
||||||
|
|
||||||
|
serialized = Stripe::StripeObject.serialize_params(obj)
|
||||||
|
assert_equal({ :id => 'id', :metadata => { :foo => 'bar' } }, serialized)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user