Skip to content

Commit

Permalink
Fix broken specs due to Solidus factory changes
Browse files Browse the repository at this point in the history
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.
solidusio/solidus#4272
  • Loading branch information
RyanofWoods committed Nov 17, 2022
1 parent 771e004 commit d6dfe33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' }

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/models/solidus_paypal_braintree/transaction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

before do
create(:country, iso: "US")
create(:state, state_code: "WA")
end

it { is_expected.to be true }
Expand Down

0 comments on commit d6dfe33

Please sign in to comment.