From 6af8c47c0eab1f7ee33b2987c6a2e3422b756286 Mon Sep 17 00:00:00 2001 From: Ryan Woods Date: Wed, 26 Oct 2022 17:25:58 +0200 Subject: [PATCH] Fix broken specs due to Solidus factory changes Due to the following PR, the Country factory no longer always returns true for `states_required`. It can be true for the appropriate countries that require a state in shipping addresses. Because of this, addresses using a country where `states_required` is true, such as the US, need a state in the Spree::Address record to be valid. https://github.com/solidusio/solidus/pull/4272 --- .../solidus_paypal_braintree/transaction_import_spec.rb | 6 ++++-- spec/models/solidus_paypal_braintree/transaction_spec.rb | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/models/solidus_paypal_braintree/transaction_import_spec.rb b/spec/models/solidus_paypal_braintree/transaction_import_spec.rb index f14e8acc..01095395 100644 --- a/spec/models/solidus_paypal_braintree/transaction_import_spec.rb +++ b/spec/models/solidus_paypal_braintree/transaction_import_spec.rb @@ -39,6 +39,10 @@ ) end + before do + create(:state, state_code: "WA") + end + it { is_expected.to be false } it "sets useful error messages" do @@ -115,7 +119,6 @@ } let(:payment_method) { create_gateway } - let(:country) { create :country, iso: 'US', states_required: true } let(:transaction_address) { nil } let(:end_state) { 'confirm' } @@ -132,7 +135,6 @@ before do # create a shipping method so we can push through to the end - country create :shipping_method, cost: 5 # ensure payments have the same number so VCR matches the request body diff --git a/spec/models/solidus_paypal_braintree/transaction_spec.rb b/spec/models/solidus_paypal_braintree/transaction_spec.rb index 3965b9e5..6c2038ef 100644 --- a/spec/models/solidus_paypal_braintree/transaction_spec.rb +++ b/spec/models/solidus_paypal_braintree/transaction_spec.rb @@ -28,6 +28,7 @@ before do create(:country, iso: "US") + create(:state, state_code: "WA") end it { is_expected.to be true }