Sha256: a0b1851580a771526480e70b7aee9c66fd2722dc3e10279d3ebe7eb83a5764cf

Contents?: true

Size: 455 Bytes

Versions: 15

Compression:

Stored size: 455 Bytes

Contents

Factory.sequence(:taxon_sequence) {|n| "Taxon ##{n}"}

Factory.define(:taxon) do |record|
  record.name { Factory.next(:taxon_sequence) } 

  # associations: 
  record.association(:taxonomy, :factory => :taxonomy)
  record.association(:parent, :factory => :root_taxon)
end

Factory.define(:root_taxon, :class=>Taxon) do |record|
  record.name { Factory.next(:taxon_sequence) }

  # associations:
  record.association(:taxonomy, :factory => :taxonomy)
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-0.11.4 test/factories/taxon_factory.rb
spree-0.11.3 test/factories/taxon_factory.rb
spree-0.11.2 test/factories/taxon_factory.rb
spree-0.11.1 test/factories/taxon_factory.rb
spree-0.11.0 test/factories/taxon_factory.rb
spree-0.10.2 test/factories/taxon_factory.rb
spree-0.10.1 test/factories/taxon_factory.rb
spree-0.10.0 test/factories/taxon_factory.rb
spree-0.10.0.beta test/factories/taxon_factory.rb
spree-enriquez-0.9.4 test/factories/taxon_factory.rb
spree-0.9.4 test/factories/taxon_factory.rb
spree-0.9.3 test/factories/taxon_factory.rb
spree-0.9.2 test/factories/taxon_factory.rb
spree-0.9.1 test/factories/taxon_factory.rb
spree-0.9.0 test/factories/taxon_factory.rb