2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-11-22 19:21:09 +00:00
|
|
|
Factory.define(:repository) do |p|
|
2011-11-29 14:36:51 +00:00
|
|
|
p.description { Factory.next(:string) }
|
|
|
|
p.name { Factory.next(:unixname) }
|
2011-11-22 19:21:09 +00:00
|
|
|
p.association :platform, :factory => :platform
|
|
|
|
p.association :owner, :factory => :user
|
2011-11-23 18:12:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Factory.define(:personal_repository, :class => Repository) do |p|
|
2011-11-29 14:36:51 +00:00
|
|
|
p.description { Factory.next(:string) }
|
|
|
|
p.name { Factory.next(:unixname) }
|
2011-11-23 18:12:20 +00:00
|
|
|
p.association :platform, :factory => :platform
|
|
|
|
p.association :owner, :factory => :user
|
|
|
|
|
|
|
|
p.after_create { |rep|
|
|
|
|
rep.platform.platform_type = 'personal'
|
2011-11-30 09:53:53 +00:00
|
|
|
rep.platform.visibility = 'hidden'
|
2011-11-29 17:45:03 +00:00
|
|
|
rep.platform.save!
|
2011-11-23 18:12:20 +00:00
|
|
|
}
|
2011-11-29 14:36:51 +00:00
|
|
|
end
|