Skip to content

Instantly share code, notes, and snippets.

@bryanl
Created December 18, 2008 15:59
Show Gist options
  • Select an option

  • Save bryanl/37540 to your computer and use it in GitHub Desktop.

Select an option

Save bryanl/37540 to your computer and use it in GitHub Desktop.
Factory.sequence :filename do |n|
"file_#{n}"
end
Factory.sequence :path do |n|
"path_#{n}"
end
Factory.define :site_path do |f|
f.name { Factory.next(:path) }
end
Factory.define :release do |f|
f.name { Factory.next(:filename) }
end
Factory.define :path_membership do |f|
f.association :site_path, :factory => :site_path
f.association :release, :factory => :release
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment