2011-10-08 23:36:38 +02:00
|
|
|
require File.join(Rails.root, 'spec', 'factory')
|
|
|
|
|
|
|
|
Factory.add(:project, Project) do |obj|
|
|
|
|
obj.name = Faker::Internet.user_name
|
2012-03-13 22:54:49 +01:00
|
|
|
obj.path = 'gitlabhq'
|
2011-10-09 21:36:57 +02:00
|
|
|
obj.owner = Factory(:user)
|
2011-10-08 23:36:38 +02:00
|
|
|
obj.code = 'LGT'
|
|
|
|
end
|
|
|
|
|
2012-07-18 23:24:37 +02:00
|
|
|
Factory.add(:project_without_owner, Project) do |obj|
|
|
|
|
obj.name = Faker::Internet.user_name
|
|
|
|
obj.path = 'gitlabhq'
|
|
|
|
obj.code = 'LGT'
|
|
|
|
end
|
|
|
|
|
2011-10-08 23:36:38 +02:00
|
|
|
Factory.add(:public_project, Project) do |obj|
|
|
|
|
obj.name = Faker::Internet.user_name
|
2012-03-13 22:54:49 +01:00
|
|
|
obj.path = 'gitlabhq'
|
2011-10-08 23:36:38 +02:00
|
|
|
obj.private_flag = false
|
2011-10-09 21:36:57 +02:00
|
|
|
obj.owner = Factory(:user)
|
2011-10-08 23:36:38 +02:00
|
|
|
obj.code = 'LGT'
|
|
|
|
end
|
|
|
|
|
|
|
|
Factory.add(:user, User) do |obj|
|
|
|
|
obj.email = Faker::Internet.email
|
|
|
|
obj.password = "123456"
|
|
|
|
obj.name = Faker::Name.name
|
|
|
|
obj.password_confirmation = "123456"
|
|
|
|
end
|
|
|
|
|
|
|
|
Factory.add(:admin, User) do |obj|
|
|
|
|
obj.email = Faker::Internet.email
|
|
|
|
obj.password = "123456"
|
|
|
|
obj.name = Faker::Name.name
|
|
|
|
obj.password_confirmation = "123456"
|
|
|
|
obj.admin = true
|
|
|
|
end
|
|
|
|
|
|
|
|
Factory.add(:issue, Issue) do |obj|
|
|
|
|
obj.title = Faker::Lorem.sentence
|
2012-02-28 15:01:14 +01:00
|
|
|
obj.author = Factory :user
|
|
|
|
obj.assignee = Factory :user
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
|
2011-11-28 19:42:32 +01:00
|
|
|
Factory.add(:merge_request, MergeRequest) do |obj|
|
|
|
|
obj.title = Faker::Lorem.sentence
|
2012-02-28 15:01:14 +01:00
|
|
|
obj.author = Factory :user
|
|
|
|
obj.assignee = Factory :user
|
2011-11-28 19:42:32 +01:00
|
|
|
obj.source_branch = "master"
|
2012-03-13 22:54:49 +01:00
|
|
|
obj.target_branch = "stable"
|
2011-12-15 22:21:29 +01:00
|
|
|
obj.closed = false
|
2011-11-28 19:42:32 +01:00
|
|
|
end
|
|
|
|
|
2011-10-16 23:07:10 +02:00
|
|
|
Factory.add(:snippet, Snippet) do |obj|
|
|
|
|
obj.title = Faker::Lorem.sentence
|
|
|
|
obj.file_name = Faker::Lorem.sentence
|
|
|
|
obj.content = Faker::Lorem.sentences
|
|
|
|
end
|
|
|
|
|
2011-10-08 23:36:38 +02:00
|
|
|
Factory.add(:note, Note) do |obj|
|
|
|
|
obj.note = Faker::Lorem.sentence
|
|
|
|
end
|
|
|
|
|
|
|
|
Factory.add(:key, Key) do |obj|
|
|
|
|
obj.title = "Example key"
|
|
|
|
obj.key = File.read(File.join(Rails.root, "db", "pkey.example"))
|
|
|
|
end
|
2011-12-14 17:38:52 +01:00
|
|
|
|
2012-07-15 16:36:06 +02:00
|
|
|
Factory.add(:project_hook, ProjectHook) do |obj|
|
2012-05-29 14:35:34 +02:00
|
|
|
obj.url = Faker::Internet.uri("http")
|
2011-12-14 17:38:52 +01:00
|
|
|
end
|
2012-02-21 18:18:06 +01:00
|
|
|
|
2012-07-18 23:24:37 +02:00
|
|
|
Factory.add(:system_hook, SystemHook) do |obj|
|
|
|
|
obj.url = Faker::Internet.uri("http")
|
|
|
|
end
|
|
|
|
|
2012-03-28 21:53:45 +02:00
|
|
|
Factory.add(:wiki, Wiki) do |obj|
|
2012-02-21 18:18:06 +01:00
|
|
|
obj.title = Faker::Lorem.sentence
|
|
|
|
obj.content = Faker::Lorem.sentence
|
2012-03-28 21:53:45 +02:00
|
|
|
obj.user = Factory(:user)
|
|
|
|
obj.project = Factory(:project)
|
2012-02-21 18:18:06 +01:00
|
|
|
end
|
2012-02-28 15:01:14 +01:00
|
|
|
|
|
|
|
Factory.add(:event, Event) do |obj|
|
|
|
|
obj.title = Faker::Lorem.sentence
|
|
|
|
obj.project = Factory(:project)
|
|
|
|
end
|
2012-04-09 00:01:42 +02:00
|
|
|
|
|
|
|
Factory.add(:milestone, Milestone) do |obj|
|
|
|
|
obj.title = Faker::Lorem.sentence
|
|
|
|
obj.due_date = Date.today + 1.month
|
|
|
|
end
|
2012-08-26 23:13:03 +02:00
|
|
|
|
|
|
|
Factory.add(:users_project, UsersProject) do |obj|
|
|
|
|
obj.user = Factory :user
|
|
|
|
obj.project = Factory :project
|
|
|
|
end
|