gitlab-org--gitlab-foss/db/fixtures/development/10_merge_requests.rb
Robert Speicher 9789b56a31 Update ffaker gem
Adds a version requirement which it didn't have before, at 2.0.0. This
version has breaking API changes in that the namespace is now `FFaker`
instead of `Faker`.
2015-05-20 19:22:00 -04:00

41 lines
1.2 KiB
Ruby

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: FFaker::Lorem.sentence(6),
description: FFaker::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