diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/lib/gitlab/import_export/project/tree_restorer_spec.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/lib/gitlab/import_export/project/tree_restorer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/project/tree_restorer_spec.rb | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb index 157cd408da9..47d7555c8f4 100644 --- a/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb @@ -254,6 +254,16 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do end end + it 'has multiple merge request assignees' do + expect(MergeRequest.find_by(title: 'MR1').assignees).to contain_exactly(@user, *@existing_members) + expect(MergeRequest.find_by(title: 'MR2').assignees).to be_empty + end + + it 'has multiple merge request reviewers' do + expect(MergeRequest.find_by(title: 'MR1').reviewers).to contain_exactly(@user, *@existing_members) + expect(MergeRequest.find_by(title: 'MR2').reviewers).to be_empty + end + it 'has labels associated to label links, associated to issues' do expect(Label.first.label_links.first.target).not_to be_nil end @@ -262,6 +272,11 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do expect(ProjectLabel.count).to eq(3) end + it 'has merge request approvals' do + expect(MergeRequest.find_by(title: 'MR1').approvals.pluck(:user_id)).to contain_exactly(@user.id, *@existing_members.map(&:id)) + expect(MergeRequest.find_by(title: 'MR2').approvals).to be_empty + end + it 'has no group labels' do expect(GroupLabel.count).to eq(0) end @@ -589,7 +604,7 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do it 'issue system note metadata restored successfully' do note_content = 'created merge request !1 to address this issue' - note = project.issues.first.notes.find { |n| n.note.match(/#{note_content}/)} + note = project.issues.first.notes.find { |n| n.note.match(/#{note_content}/) } expect(note.noteable_type).to eq('Issue') expect(note.system).to eq(true) @@ -1085,35 +1100,13 @@ RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do end end - context 'when import_relation_object_persistence feature flag is enabled' do - before do - stub_feature_flags(import_relation_object_persistence: true) - end - - context 'enable ndjson import' do - it_behaves_like 'project tree restorer work properly', :legacy_reader, true + context 'enable ndjson import' do + it_behaves_like 'project tree restorer work properly', :legacy_reader, true - it_behaves_like 'project tree restorer work properly', :ndjson_reader, true - end - - context 'disable ndjson import' do - it_behaves_like 'project tree restorer work properly', :legacy_reader, false - end + it_behaves_like 'project tree restorer work properly', :ndjson_reader, true end - context 'when import_relation_object_persistence feature flag is disabled' do - before do - stub_feature_flags(import_relation_object_persistence: false) - end - - context 'enable ndjson import' do - it_behaves_like 'project tree restorer work properly', :legacy_reader, true - - it_behaves_like 'project tree restorer work properly', :ndjson_reader, true - end - - context 'disable ndjson import' do - it_behaves_like 'project tree restorer work properly', :legacy_reader, false - end + context 'disable ndjson import' do + it_behaves_like 'project tree restorer work properly', :legacy_reader, false end end |