fixtures added
This commit is contained in:
parent
a41d57691d
commit
03e51c3058
5 changed files with 58 additions and 17 deletions
|
@ -1,3 +1,5 @@
|
|||
require File.join(Rails.root, "lib", "gitlabhq", "git_host")
|
||||
|
||||
class Repository
|
||||
attr_accessor :project
|
||||
|
||||
|
@ -34,13 +36,13 @@ class Repository
|
|||
end
|
||||
|
||||
def update_gitosis_project
|
||||
GitProxy.system.new.configure do |c|
|
||||
Gitlabhq::GitHost.system.new.configure do |c|
|
||||
c.update_project(path, project.gitosis_writers)
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_gitosis_project
|
||||
GitProxy.system.new.configure do |c|
|
||||
Gitlabhq::GitHost.system.new.configure do |c|
|
||||
c.destroy_project(@project)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,19 +1,21 @@
|
|||
admin = User.create(
|
||||
:email => "admin@local.host",
|
||||
:name => "Administrator",
|
||||
:password => "5iveL!fe",
|
||||
:password_confirmation => "5iveL!fe"
|
||||
)
|
||||
unless User.count > 0
|
||||
admin = User.create(
|
||||
:email => "admin@local.host",
|
||||
:name => "Administrator",
|
||||
:password => "5iveL!fe",
|
||||
:password_confirmation => "5iveL!fe"
|
||||
)
|
||||
|
||||
admin.projects_limit = 10000
|
||||
admin.admin = true
|
||||
admin.save!
|
||||
admin.projects_limit = 10000
|
||||
admin.admin = true
|
||||
admin.save!
|
||||
|
||||
if admin.valid?
|
||||
puts %q[
|
||||
Administrator account created:
|
||||
if admin.valid?
|
||||
puts %q[
|
||||
Administrator account created:
|
||||
|
||||
login.........admin@local.host
|
||||
password......5iveL!fe
|
||||
]
|
||||
login.........admin@local.host
|
||||
password......5iveL!fe
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
5
db/fixtures/development/002_project.rb
Normal file
5
db/fixtures/development/002_project.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Project.seed(:id, [
|
||||
{ :id => 1, :name => "Gitlab HQ", :path => "gitlabhq", :code => "gitlabhq", :owner_id => 1 },
|
||||
{ :id => 2, :name => "Diaspora", :path => "diaspora", :code => "diaspora", :owner_id => 1 },
|
||||
{ :id => 3, :name => "Ruby on Rails", :path => "ruby_on_rails", :code => "ruby_on_rails", :owner_id => 1 }
|
||||
])
|
11
db/fixtures/development/003_users.rb
Normal file
11
db/fixtures/development/003_users.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
User.seed(:id, [
|
||||
{ :id => 2, :name => Faker::Internet.user_name, :email => Faker::Internet.email},
|
||||
{ :id => 3, :name => Faker::Internet.user_name, :email => Faker::Internet.email},
|
||||
{ :id => 4, :name => Faker::Internet.user_name, :email => Faker::Internet.email},
|
||||
{ :id => 5, :name => Faker::Internet.user_name, :email => Faker::Internet.email},
|
||||
{ :id => 6, :name => Faker::Internet.user_name, :email => Faker::Internet.email},
|
||||
{ :id => 7, :name => Faker::Internet.user_name, :email => Faker::Internet.email},
|
||||
{ :id => 8, :name => Faker::Internet.user_name, :email => Faker::Internet.email},
|
||||
{ :id => 9, :name => Faker::Internet.user_name, :email => Faker::Internet.email}
|
||||
])
|
||||
|
21
db/fixtures/development/004_teams.rb
Normal file
21
db/fixtures/development/004_teams.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
UsersProject.seed(:id, [
|
||||
{ :id => 1, :project_id => 1, :user_id => 1},
|
||||
{ :id => 2, :project_id => 1, :user_id => 2},
|
||||
{ :id => 3, :project_id => 1, :user_id => 3},
|
||||
{ :id => 4, :project_id => 1, :user_id => 4},
|
||||
{ :id => 5, :project_id => 1, :user_id => 5},
|
||||
|
||||
{ :id => 6, :project_id => 2, :user_id => 1},
|
||||
{ :id => 7, :project_id => 2, :user_id => 2},
|
||||
{ :id => 8, :project_id => 2, :user_id => 3},
|
||||
{ :id => 9, :project_id => 2, :user_id => 4},
|
||||
{ :id => 11, :project_id => 2, :user_id => 5},
|
||||
|
||||
{ :id => 12, :project_id => 3, :user_id => 1},
|
||||
{ :id => 13, :project_id => 3, :user_id => 2},
|
||||
{ :id => 14, :project_id => 3, :user_id => 3},
|
||||
{ :id => 15, :project_id => 3, :user_id => 4},
|
||||
{ :id => 16, :project_id => 3, :user_id => 5}
|
||||
])
|
||||
|
||||
|
Loading…
Reference in a new issue