Sha256: 20662355192c42e29087a40fd3e7738aa8d2c72298e2a524a27af33e54f070c1

Contents?: true

Size: 558 Bytes

Versions: 10

Compression:

Stored size: 558 Bytes

Contents

Factory.sequence(:zone_sequence) {|n| "Zone ##{n}"}

Factory.define(:global_zone, :class => Zone) do |record|
  record.name "GlobalZone"
  record.description { Faker::Lorem.sentence }
  record.zone_members {|proxy|
    zone = proxy.instance_eval{@instance}
    Country.find(:all).map{|c| ZoneMember.create({:zoneable => c, :zone => zone})}
  }
end

Factory.define(:zone) do |f|
  f.name { Faker::Lorem.words.join(' ') }
  f.description { Faker::Lorem.sentence }
  f.zone_members do |member|
    [ZoneMember.create(:zoneable => Factory(:country) )]
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_core-0.70.7 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.6 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.5 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.4 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.3 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.2 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.1 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.0 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.0.rc2 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.70.RC1 lib/spree_core/testing_support/factories/zone_factory.rb