Sha256: bbdc8674666957a704257d3ca9573fe765a40559360aa761b516dc1b58a2f27f
Contents?: true
Size: 587 Bytes
Versions: 44
Compression:
Stored size: 587 Bytes
Contents
# frozen_string_literal: true require 'spree/testing_support/sequences' require 'spree/testing_support/factories/country_factory' FactoryBot.define do factory :global_zone, class: 'Spree::Zone' do name { 'GlobalZone' } zone_members do |proxy| zone = proxy.instance_eval { @instance } Spree::Country.all.map do |c| Spree::ZoneMember.create(zoneable: c, zone: zone) end end end factory :zone, class: 'Spree::Zone' do sequence(:name) { |i| "Zone #{i}" } trait :with_country do countries { [create(:country)] } end end end
Version data entries
44 entries across 44 versions & 2 rubygems