Sha256: a821254f67b0d5bb0f2d1452753897addd4f90737dbc1df133c1ab347c4b769f

Contents?: true

Size: 548 Bytes

Versions: 19

Compression:

Stored size: 548 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 }
  f.description { Faker::Lorem.sentence }
  f.zone_members do |member|
    [ZoneMember.create(:zoneable => Factory(:country) )]
  end
end

Version data entries

19 entries across 19 versions & 6 rubygems

Version Path
apispree_core-0.0.0 lib/spree_core/testing_support/factories/zone_factory.rb
My-Commerce_core-1.1.0 lib/spree_core/testing_support/factories/zone_factory.rb
My-Commerce_core-1.0.0 lib/spree_core/testing_support/factories/zone_factory.rb
MyCommerceapi-1.0.0 core/lib/spree_core/testing_support/factories/zone_factory.rb
MyCommerce-0.0.3 core/lib/spree_core/testing_support/factories/zone_factory.rb
rfcommerce_core-0.0.3 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.6 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.5 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.50.4 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.4 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.50.3 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.3 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.2 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.1 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.0 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.60.0.RC1 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.50.2 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.50.1 lib/spree_core/testing_support/factories/zone_factory.rb
spree_core-0.50.0 lib/spree_core/testing_support/factories/zone_factory.rb