Sha256: 1faba8878e6d4fa351b63c73e669f390b476be35bc95951ef98af5ee3cd987bc

Contents?: true

Size: 559 Bytes

Versions: 10

Compression:

Stored size: 559 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 do |c|
        zone_member = Spree::ZoneMember.create(:zoneable => c, :zone => zone)
      end
    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

10 entries across 10 versions & 1 rubygems

Version Path
spree_core-1.1.6 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.5 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.4 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.3 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.2 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.2.rc1 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.1 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.0 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.0.rc2 lib/spree/core/testing_support/factories/zone_factory.rb
spree_core-1.1.0.rc1 lib/spree/core/testing_support/factories/zone_factory.rb