diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2011-12-05 00:19:49 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2011-12-05 00:19:49 +0400 |
commit | 03e51c30583908882204d2bfc8c647a7c5bc35ef (patch) | |
tree | 2ed49e9a327cf52be7162d1b0c123293257f399e /db | |
parent | a41d57691d47dce8db788d6cf97031bf1321a792 (diff) |
fixtures added
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/development/001_admin.rb | 32 | ||||
-rw-r--r-- | db/fixtures/development/002_project.rb | 5 | ||||
-rw-r--r-- | db/fixtures/development/003_users.rb | 11 | ||||
-rw-r--r-- | db/fixtures/development/004_teams.rb | 21 |
4 files changed, 54 insertions, 15 deletions
diff --git a/db/fixtures/development/001_admin.rb b/db/fixtures/development/001_admin.rb index cfff6bf8bc2..c857f6bcb3f 100644 --- a/db/fixtures/development/001_admin.rb +++ b/db/fixtures/development/001_admin.rb @@ -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 diff --git a/db/fixtures/development/002_project.rb b/db/fixtures/development/002_project.rb new file mode 100644 index 00000000000..8eb99f2ce02 --- /dev/null +++ b/db/fixtures/development/002_project.rb @@ -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 } +]) diff --git a/db/fixtures/development/003_users.rb b/db/fixtures/development/003_users.rb new file mode 100644 index 00000000000..309eb90b1bf --- /dev/null +++ b/db/fixtures/development/003_users.rb @@ -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} +]) + diff --git a/db/fixtures/development/004_teams.rb b/db/fixtures/development/004_teams.rb new file mode 100644 index 00000000000..69742e41e21 --- /dev/null +++ b/db/fixtures/development/004_teams.rb @@ -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} +]) + + |