diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 12:06:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 12:06:03 +0000 |
commit | 16d9f66e9651d35b52e5a167789befe7b861292c (patch) | |
tree | 38ffe73aeffa5bc8ceaa3357db302edce6d874f6 /spec/lib | |
parent | 5333cb6c7c960aac58af40c898c87d050d829383 (diff) | |
download | gitlab-ce-16d9f66e9651d35b52e5a167789befe7b861292c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/import_export/all_models.yml | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/group_tree_saver_spec.rb | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 2339a090ccd..8f627fcc24d 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -30,6 +30,8 @@ issues: - prometheus_alert_events - self_managed_prometheus_alert_events - zoom_meetings +- vulnerability_links +- related_vulnerabilities events: - author - project diff --git a/spec/lib/gitlab/import_export/group_tree_saver_spec.rb b/spec/lib/gitlab/import_export/group_tree_saver_spec.rb index c752c557d99..b856441981a 100644 --- a/spec/lib/gitlab/import_export/group_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/group_tree_saver_spec.rb @@ -39,12 +39,16 @@ describe Gitlab::ImportExport::GroupTreeSaver do end context 'when :export_fast_serialize feature is enabled' do + let(:serializer) { instance_double(Gitlab::ImportExport::FastHashSerializer) } + before do stub_feature_flags(export_fast_serialize: true) + + expect(Gitlab::ImportExport::FastHashSerializer).to receive(:new).with(group, group_tree).and_return(serializer) end it 'uses FastHashSerializer' do - expect_any_instance_of(Gitlab::ImportExport::FastHashSerializer).to receive(:execute).and_call_original + expect(serializer).to receive(:execute) group_tree_saver.save end @@ -103,6 +107,18 @@ describe Gitlab::ImportExport::GroupTreeSaver do expect(saved_group_json['badges']).not_to be_empty end + context 'group children' do + let(:children) { group.children } + + it 'exports group children' do + expect(saved_group_json['children'].length).to eq(children.count) + end + + it 'exports group children of children' do + expect(saved_group_json['children'].first['children'].length).to eq(children.first.children.count) + end + end + context 'group members' do let(:user2) { create(:user, email: 'group@member.com') } let(:member_emails) do @@ -146,6 +162,8 @@ describe Gitlab::ImportExport::GroupTreeSaver do def setup_group group = create(:group, description: 'description') + sub_group = create(:group, description: 'description', parent: group) + create(:group, description: 'description', parent: sub_group) create(:milestone, group: group) create(:group_badge, group: group) group_label = create(:group_label, group: group) |