Sha256: 43c684046f4c6fcf2502b2d781e2ad5d0f10dff9cfdb88987d9be2b51e81ae72
Contents?: true
Size: 744 Bytes
Versions: 45
Compression:
Stored size: 744 Bytes
Contents
FactoryBot.define do factory :zone, class: Spree::Zone do name { generate(:random_string) } description { generate(:random_string) } factory :zone_with_country do kind { :country } zone_members do |proxy| zone = proxy.instance_eval { @instance } [Spree::ZoneMember.create(zoneable: create(:country), zone: zone)] end factory :global_zone, class: Spree::Zone do sequence(:name) { |n| "GlobalZone_#{n}" } zone_members do |proxy| zone = proxy.instance_eval { @instance } Spree::Country.all.map do |country| Spree::ZoneMember.where(zoneable: country, zone: zone).first_or_create end end end end end end
Version data entries
45 entries across 45 versions & 1 rubygems