diff --git a/.travis.yml b/.travis.yml index c16dd9122..f443fd659 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ sudo: false env: global: # If changing this number, please also change it in `test/test_helper.rb`. - - STRIPE_MOCK_VERSION=0.44.0 + - STRIPE_MOCK_VERSION=0.47.0 cache: directories: diff --git a/test/stripe/account_test.rb b/test/stripe/account_test.rb index 54d6ab279..dc2dbdec7 100644 --- a/test/stripe/account_test.rb +++ b/test/stripe/account_test.rb @@ -100,7 +100,12 @@ class AccountTest < Test::Unit::TestCase context "#legal_entity=" do should "disallow direct overrides" do - account = Stripe::Account.retrieve("acct_123") + account = Stripe::Account.construct_from( + id: "acct_123", + legal_entity: { + first_name: "name", + } + ) assert_raise NoMethodError do account.legal_entity = { first_name: "Blah" } @@ -111,7 +116,7 @@ class AccountTest < Test::Unit::TestCase end context "#serialize_params" do - should "serialize an a new additional_owners" do + should "serialize a new additional_owners" do obj = Stripe::Util.convert_to_stripe_object({ object: "account", legal_entity: Stripe::StripeObject.construct_from({ diff --git a/test/stripe/api_resource_test.rb b/test/stripe/api_resource_test.rb index ad5f22660..d2eb4fc34 100644 --- a/test/stripe/api_resource_test.rb +++ b/test/stripe/api_resource_test.rb @@ -375,20 +375,22 @@ class NestedTestAPIResource < Stripe::APIResource end should "correctly handle replaced nested objects" do - acct = Stripe::Account.construct_from(id: "myid", - legal_entity: { - last_name: "Smith", - address: { - line1: "test", - city: "San Francisco", - }, - }) - - stub_request(:post, "#{Stripe.api_base}/v1/accounts/myid") - .with(body: { legal_entity: { address: { line1: "Test2", city: "" } } }) + acct = Stripe::Account.construct_from( + id: "acct_123", + company: { + name: "company_name", + address: { + line1: "test", + city: "San Francisco", + }, + } + ) + + stub_request(:post, "#{Stripe.api_base}/v1/accounts/acct_123") + .with(body: { company: { address: { line1: "Test2", city: "" } } }) .to_return(body: JSON.generate("id" => "my_id")) - acct.legal_entity.address = { line1: "Test2" } + acct.company.address = { line1: "Test2" } acct.save end diff --git a/test/test_helper.rb b/test/test_helper.rb index a3a428e5f..56f38b62a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -17,7 +17,7 @@ require ::File.expand_path("../stripe_mock", __FILE__) # If changing this number, please also change it in `.travis.yml`. -MOCK_MINIMUM_VERSION = "0.44.0".freeze +MOCK_MINIMUM_VERSION = "0.47.0".freeze MOCK_PORT = Stripe::StripeMock.start # Disable all real network connections except those that are outgoing to