diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 06:06:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-15 06:06:34 +0300 |
commit | 41d446ba3f0518097eb350b142ecfbeeb6be83e6 (patch) | |
tree | 465127e4d63fe9d0c61ab7f281737e588a04a4ae /spec | |
parent | 386e5740f68fc7f49bc7692a28e927d6ea5ab056 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/import_export/group_project_object_builder_spec.rb | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/spec/lib/gitlab/import_export/group_project_object_builder_spec.rb b/spec/lib/gitlab/import_export/group_project_object_builder_spec.rb index 6a803c48b34..1a5cb7806a3 100644 --- a/spec/lib/gitlab/import_export/group_project_object_builder_spec.rb +++ b/spec/lib/gitlab/import_export/group_project_object_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::ImportExport::GroupProjectObjectBuilder do let(:project) do - create(:project, + create(:project, :repository, :builds_disabled, :issues_disabled, name: 'project', @@ -11,8 +11,8 @@ describe Gitlab::ImportExport::GroupProjectObjectBuilder do end context 'labels' do - it 'finds the right group label' do - group_label = create(:group_label, 'name': 'group label', 'group': project.group) + it 'finds the existing group label' do + group_label = create(:group_label, name: 'group label', group: project.group) expect(described_class.build(Label, 'title' => 'group label', @@ -31,8 +31,8 @@ describe Gitlab::ImportExport::GroupProjectObjectBuilder do end context 'milestones' do - it 'finds the right group milestone' do - milestone = create(:milestone, 'name' => 'group milestone', 'group' => project.group) + it 'finds the existing group milestone' do + milestone = create(:milestone, name: 'group milestone', group: project.group) expect(described_class.build(Milestone, 'title' => 'group milestone', @@ -49,4 +49,30 @@ describe Gitlab::ImportExport::GroupProjectObjectBuilder do expect(milestone.persisted?).to be true end end + + context 'merge_request' do + it 'finds the existing merge_request' do + merge_request = create(:merge_request, title: 'MergeRequest', iid: 7, target_project: project, source_project: project) + expect(described_class.build(MergeRequest, + 'title' => 'MergeRequest', + 'source_project_id' => project.id, + 'target_project_id' => project.id, + 'source_branch' => 'SourceBranch', + 'iid' => 7, + 'target_branch' => 'TargetBranch', + 'author_id' => project.creator.id)).to eq(merge_request) + end + + it 'creates a new merge_request' do + merge_request = described_class.build(MergeRequest, + 'title' => 'MergeRequest', + 'iid' => 8, + 'source_project_id' => project.id, + 'target_project_id' => project.id, + 'source_branch' => 'SourceBranch', + 'target_branch' => 'TargetBranch', + 'author_id' => project.creator.id) + expect(merge_request.persisted?).to be true + end + end end |