From a91bb6e35509cb6145019f27aa82811262805c9b Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 27 Sep 2021 11:01:00 +1000 Subject: [PATCH] Fix order dependent reports spec Depending on the order of spec execution, it was possible that a factory created the default state "Alabama" with the default country "USA" instead of using the usual seed data of "Victoria" in "Australia". Some specs rely on "Victoria" though and we now make sure that it's created even if another spec created another country first. --- spec/support/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/seeds.rb b/spec/support/seeds.rb index 7b098401a2..8321705e3d 100644 --- a/spec/support/seeds.rb +++ b/spec/support/seeds.rb @@ -7,7 +7,7 @@ # leaves them there when deleting the rest (see spec/spec_helper.rb). # You can add more entries here if you need them for your tests. -if Spree::Country.where(nil).empty? +if Spree::Country.where(name: "Australia").empty? Spree::Country.create!({ "name" => "Australia", "iso3" => "AUS", "iso" => "AU", "iso_name" => "AUSTRALIA", "numcode" => "36" }) country = Spree::Country.find_by(name: 'Australia')