rosa-build/spec/factories/repository_factory.rb

17 lines
517 B
Ruby
Raw Normal View History

2011-11-22 19:21:09 +00:00
Factory.define(:repository) do |p|
p.name { Factory.next(:string) }
p.unixname { Factory.next(:unixname) }
p.association :platform, :factory => :platform
p.association :owner, :factory => :user
end
Factory.define(:personal_repository, :class => Repository) do |p|
p.name { Factory.next(:string) }
p.unixname { Factory.next(:unixname) }
p.association :platform, :factory => :platform
p.association :owner, :factory => :user
p.after_create { |rep|
rep.platform.platform_type = 'personal'
}
2011-11-22 19:21:09 +00:00
end