Standardise default country and state

The OFN software was first written in Melbourne and a lot of spec code
relies on the state Victoria being in the database. When we imported
Spree code, it came with its default state Alabame in the USA. Having
two different defaults is confusing and caused specs to fail in rare
circumstances. Let's standardise it here which will also open the path
to removing the seeding of test data and the exclusion of states and
countries in the database cleaner.
This commit is contained in:
Maikel Linke
2021-09-27 12:38:31 +10:00
parent a91bb6e355
commit cb2c6835c4
2 changed files with 8 additions and 14 deletions

View File

@@ -2,10 +2,10 @@
FactoryBot.define do
factory :country, class: Spree::Country do
iso_name { 'UNITED STATES' }
name { 'United States of America' }
iso { 'US' }
iso3 { 'USA' }
numcode { 840 }
iso_name { "AUSTRALIA" }
name { "Australia" }
iso { "AU" }
iso3 { "AUS" }
numcode { 36 }
end
end

View File

@@ -2,14 +2,8 @@
FactoryBot.define do
factory :state, class: Spree::State do
name { 'Alabama' }
abbr { 'AL' }
country do |country|
if usa = Spree::Country.find_by(numcode: 840)
country = usa
else
country.association(:country)
end
end
name { "Victoria" }
abbr { "Vic" }
country
end
end