Sha256: bd4932655ecc0f8afa93bb658fc40fa5eef1c5a203426914ae491fde17f82eca

Contents?: true

Size: 528 Bytes

Versions: 11

Compression:

Stored size: 528 Bytes

Contents

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

  factory :zone, :class => Spree::Zone do
    name { Faker::Lorem.words }
    description { Faker::Lorem.sentence }
    zone_members { [Spree::ZoneMember.create(:zoneable => Factory(:country) )] }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_core-1.0.7 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.6 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.4 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.3 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.2 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.1 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.0 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.0.rc4 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.0.rc3 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.0.rc2 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.0.0.rc1 lib/spree/core/testing_support/factories/zone_factory.rb