diff --git a/core/lib/spree/testing_support/factories/zone_factory.rb b/core/lib/spree/testing_support/factories/zone_factory.rb index 4bb30cef97c..c425c1982b8 100644 --- a/core/lib/spree/testing_support/factories/zone_factory.rb +++ b/core/lib/spree/testing_support/factories/zone_factory.rb @@ -5,7 +5,7 @@ FactoryBot.define do factory :global_zone, class: 'Spree::Zone' do - name { 'GlobalZone' } + initialize_with { Spree::Zone.find_or_initialize_by(name: 'GlobalZone') } zone_members do |proxy| zone = proxy.instance_eval { @instance } Spree::Country.all.map do |c|