diff options
Diffstat (limited to 'db/fixtures/development')
-rw-r--r-- | db/fixtures/development/01_admin.rb | 13 | ||||
-rw-r--r-- | db/fixtures/development/04_project.rb | 52 | ||||
-rw-r--r-- | db/fixtures/development/05_users.rb | 32 | ||||
-rw-r--r-- | db/fixtures/development/06_teams.rb | 21 | ||||
-rw-r--r-- | db/fixtures/development/07_milestones.rb | 16 | ||||
-rw-r--r-- | db/fixtures/development/09_issues.rb | 16 | ||||
-rw-r--r-- | db/fixtures/development/10_merge_requests.rb | 41 | ||||
-rw-r--r-- | db/fixtures/development/11_keys.rb | 12 | ||||
-rw-r--r-- | db/fixtures/development/12_snippets.rb | 40 | ||||
-rw-r--r-- | db/fixtures/development/13_comments.rb | 31 |
10 files changed, 0 insertions, 274 deletions
diff --git a/db/fixtures/development/01_admin.rb b/db/fixtures/development/01_admin.rb deleted file mode 100644 index bba2fc4b186..00000000000 --- a/db/fixtures/development/01_admin.rb +++ /dev/null @@ -1,13 +0,0 @@ -Gitlab::Seeder.quiet do - User.seed do |s| - s.id = 1 - s.name = 'Administrator' - s.email = 'admin@example.com' - s.notification_email = 'admin@example.com' - s.username = 'root' - s.password = '5iveL!fe' - s.admin = true - s.projects_limit = 100 - s.confirmed_at = DateTime.now - end -end diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb deleted file mode 100644 index ae4c0550a4f..00000000000 --- a/db/fixtures/development/04_project.rb +++ /dev/null @@ -1,52 +0,0 @@ -require 'sidekiq/testing' - -Sidekiq::Testing.inline! do - Gitlab::Seeder.quiet do - project_urls = [ - 'https://github.com/documentcloud/underscore.git', - 'https://gitlab.com/gitlab-org/gitlab-ce.git', - 'https://gitlab.com/gitlab-org/gitlab-ci.git', - 'https://gitlab.com/gitlab-org/gitlab-shell.git', - 'https://gitlab.com/gitlab-org/gitlab-test.git', - 'https://github.com/twitter/flight.git', - 'https://github.com/twitter/typeahead.js.git', - 'https://github.com/h5bp/html5-boilerplate.git', - ] - - project_urls.each_with_index do |url, i| - group_path, project_path = url.split('/')[-2..-1] - - group = Group.find_by(path: group_path) - - unless group - group = Group.new( - name: group_path.titleize, - path: group_path - ) - group.description = Faker::Lorem.sentence - group.save - - group.add_owner(User.first) - end - - project_path.gsub!(".git", "") - - params = { - import_url: url, - namespace_id: group.id, - name: project_path.titleize, - description: Faker::Lorem.sentence, - visibility_level: Gitlab::VisibilityLevel.values.sample - } - - project = Projects::CreateService.new(User.first, params).execute - - if project.valid? - print '.' - else - puts project.errors.full_messages - print 'F' - end - end - end -end diff --git a/db/fixtures/development/05_users.rb b/db/fixtures/development/05_users.rb deleted file mode 100644 index 24952a1f661..00000000000 --- a/db/fixtures/development/05_users.rb +++ /dev/null @@ -1,32 +0,0 @@ -Gitlab::Seeder.quiet do - (2..20).each do |i| - begin - User.create!( - username: Faker::Internet.user_name, - name: Faker::Name.name, - email: Faker::Internet.email, - confirmed_at: DateTime.now, - password: '12345678' - ) - - print '.' - rescue ActiveRecord::RecordInvalid - print 'F' - end - end - - (1..5).each do |i| - begin - User.create!( - username: "user#{i}", - name: "User #{i}", - email: "user#{i}@example.com", - confirmed_at: DateTime.now, - password: '12345678' - ) - print '.' - rescue ActiveRecord::RecordInvalid - print 'F' - end - end -end diff --git a/db/fixtures/development/06_teams.rb b/db/fixtures/development/06_teams.rb deleted file mode 100644 index 3e8cdcd67b4..00000000000 --- a/db/fixtures/development/06_teams.rb +++ /dev/null @@ -1,21 +0,0 @@ -Gitlab::Seeder.quiet do - Group.all.each do |group| - User.all.sample(4).each do |user| - if group.add_users([user.id], Gitlab::Access.values.sample) - print '.' - else - print 'F' - end - end - end - - Project.all.each do |project| - User.all.sample(4).each do |user| - if project.team << [user, Gitlab::Access.values.sample] - print '.' - else - print 'F' - end - end - end -end diff --git a/db/fixtures/development/07_milestones.rb b/db/fixtures/development/07_milestones.rb deleted file mode 100644 index 2296821e528..00000000000 --- a/db/fixtures/development/07_milestones.rb +++ /dev/null @@ -1,16 +0,0 @@ -Gitlab::Seeder.quiet do - Project.all.each do |project| - (1..5).each do |i| - milestone_params = { - title: "v#{i}.0", - description: Faker::Lorem.sentence, - state: ['opened', 'closed'].sample, - } - - milestone = Milestones::CreateService.new( - project, project.team.users.sample, milestone_params).execute - - print '.' - end - end -end diff --git a/db/fixtures/development/09_issues.rb b/db/fixtures/development/09_issues.rb deleted file mode 100644 index e8b01b46d22..00000000000 --- a/db/fixtures/development/09_issues.rb +++ /dev/null @@ -1,16 +0,0 @@ -Gitlab::Seeder.quiet do - Project.all.each do |project| - (1..10).each do |i| - issue_params = { - title: Faker::Lorem.sentence(6), - description: Faker::Lorem.sentence, - state: ['opened', 'closed'].sample, - milestone: project.milestones.sample, - assignee: project.team.users.sample - } - - Issues::CreateService.new(project, project.team.users.sample, issue_params).execute - print '.' - end - end -end diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb deleted file mode 100644 index f9b2fd8b05f..00000000000 --- a/db/fixtures/development/10_merge_requests.rb +++ /dev/null @@ -1,41 +0,0 @@ -Gitlab::Seeder.quiet do - Project.all.reject(&:empty_repo?).each do |project| - branches = project.repository.branch_names - - branches.each do |branch_name| - break if branches.size < 2 - source_branch = branches.pop - target_branch = branches.pop - - params = { - source_branch: source_branch, - target_branch: target_branch, - title: Faker::Lorem.sentence(6), - description: Faker::Lorem.sentences(3).join(" "), - milestone: project.milestones.sample, - assignee: project.team.users.sample - } - - MergeRequests::CreateService.new(project, project.team.users.sample, params).execute - print '.' - end - end - - project = Project.find_with_namespace('gitlab-org/gitlab-test') - - params = { - source_branch: 'feature', - target_branch: 'master', - title: 'Can be automatically merged' - } - MergeRequests::CreateService.new(project, User.admins.first, params).execute - print '.' - - params = { - source_branch: 'feature_conflict', - target_branch: 'feature', - title: 'Cannot be automatically merged' - } - MergeRequests::CreateService.new(project, User.admins.first, params).execute - print '.' -end diff --git a/db/fixtures/development/11_keys.rb b/db/fixtures/development/11_keys.rb deleted file mode 100644 index 8b4bee384e1..00000000000 --- a/db/fixtures/development/11_keys.rb +++ /dev/null @@ -1,12 +0,0 @@ -Gitlab::Seeder.quiet do - User.first(10).each do |user| - key = "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt#{user.id + 100}6k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" - - user.keys.create( - title: "Sample key #{user.id}", - key: key - ) - - print '.' - end -end diff --git a/db/fixtures/development/12_snippets.rb b/db/fixtures/development/12_snippets.rb deleted file mode 100644 index b3a6f39c7d5..00000000000 --- a/db/fixtures/development/12_snippets.rb +++ /dev/null @@ -1,40 +0,0 @@ -Gitlab::Seeder.quiet do - content =<<eos -class Member < ActiveRecord::Base - include Notifiable - include Gitlab::Access - - belongs_to :user - belongs_to :source, polymorphic: true - - validates :user, presence: true - validates :source, presence: true - validates :user_id, uniqueness: { scope: [:source_type, :source_id], message: "already exists in source" } - validates :access_level, inclusion: { in: Gitlab::Access.all_values }, presence: true - - scope :guests, -> { where(access_level: GUEST) } - scope :reporters, -> { where(access_level: REPORTER) } - scope :developers, -> { where(access_level: DEVELOPER) } - scope :masters, -> { where(access_level: MASTER) } - scope :owners, -> { where(access_level: OWNER) } - - delegate :name, :username, :email, to: :user, prefix: true -end -eos - - (1..50).each do |i| - user = User.all.sample - - PersonalSnippet.seed(:id, [{ - id: i, - author_id: user.id, - title: Faker::Lorem.sentence(3), - file_name: Faker::Internet.domain_word + '.rb', - visibility_level: Gitlab::VisibilityLevel.values.sample, - content: content, - }]) - - print('.') - end -end - diff --git a/db/fixtures/development/13_comments.rb b/db/fixtures/development/13_comments.rb deleted file mode 100644 index d37be53c7b9..00000000000 --- a/db/fixtures/development/13_comments.rb +++ /dev/null @@ -1,31 +0,0 @@ -Gitlab::Seeder.quiet do - Issue.all.each do |issue| - project = issue.project - - project.team.users.each do |user| - note_params = { - noteable_type: 'Issue', - noteable_id: issue.id, - note: Faker::Lorem.sentence, - } - - Notes::CreateService.new(project, user, note_params).execute - print '.' - end - end - - MergeRequest.all.each do |mr| - project = mr.project - - project.team.users.each do |user| - note_params = { - noteable_type: 'MergeRequest', - noteable_id: mr.id, - note: Faker::Lorem.sentence, - } - - Notes::CreateService.new(project, user, note_params).execute - print '.' - end - end -end |