Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 12:07:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 12:07:58 +0300
commit45b4df3e57c949c88107840c44ccbfaf2eabdf26 (patch)
treef73c1533a75b03d2ceb1361644e0d8ab97568a8f /spec/lib/gitlab/import_export
parent7421e6f9f2b5889b05738af7eba568af6ae3fcbc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/import_export')
-rw-r--r--spec/lib/gitlab/import_export/group/tree_saver_spec.rb44
-rw-r--r--spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb34
-rw-r--r--spec/lib/gitlab/import_export/project/legacy_tree_saver_spec.rb45
3 files changed, 8 insertions, 115 deletions
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 44fd49f0ac3..eb790662d8c 100644
--- a/spec/lib/gitlab/import_export/group/tree_saver_spec.rb
+++ b/spec/lib/gitlab/import_export/group/tree_saver_spec.rb
@@ -23,50 +23,6 @@ describe Gitlab::ImportExport::Group::TreeSaver do
expect(group_tree_saver.save).to be true
end
- context ':export_fast_serialize feature flag checks' do
- before do
- expect(Gitlab::ImportExport::Reader).to receive(:new).with(shared: shared, config: group_config).and_return(reader)
- expect(reader).to receive(:group_tree).and_return(group_tree)
- end
-
- let(:reader) { instance_double('Gitlab::ImportExport::Reader') }
- let(:group_config) { Gitlab::ImportExport::Config.new(config: Gitlab::ImportExport.group_config_file).to_h }
- let(:group_tree) do
- {
- include: [{ milestones: { include: [] } }],
- preload: { milestones: nil }
- }
- 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(serializer).to receive(:execute)
-
- group_tree_saver.save
- end
- end
-
- context 'when :export_fast_serialize feature is disabled' do
- before do
- stub_feature_flags(export_fast_serialize: false)
- end
-
- it 'is serialized via built-in `as_json`' do
- expect(group).to receive(:as_json).with(group_tree).and_call_original
-
- group_tree_saver.save
- end
- end
- end
-
# It is mostly duplicated in
# `spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb`
# except:
diff --git a/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb b/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb
index db77bd338e1..958865f52a0 100644
--- a/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb
+++ b/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb
@@ -8,35 +8,17 @@ describe Gitlab::ImportExport::LegacyRelationTreeSaver do
let(:tree) { {} }
describe '#serialize' do
- context 'when :export_fast_serialize feature is enabled' do
- let(:serializer) { instance_double(Gitlab::ImportExport::FastHashSerializer) }
+ let(:serializer) { instance_double(Gitlab::ImportExport::FastHashSerializer) }
- before do
- stub_feature_flags(export_fast_serialize: true)
- end
+ it 'uses FastHashSerializer' do
+ expect(Gitlab::ImportExport::FastHashSerializer)
+ .to receive(:new)
+ .with(exportable, tree)
+ .and_return(serializer)
- it 'uses FastHashSerializer' do
- expect(Gitlab::ImportExport::FastHashSerializer)
- .to receive(:new)
- .with(exportable, tree)
- .and_return(serializer)
+ expect(serializer).to receive(:execute)
- expect(serializer).to receive(:execute)
-
- relation_tree_saver.serialize(exportable, tree)
- end
- end
-
- context 'when :export_fast_serialize feature is disabled' do
- before do
- stub_feature_flags(export_fast_serialize: false)
- end
-
- it 'is serialized via built-in `as_json`' do
- expect(exportable).to receive(:as_json).with(tree)
-
- relation_tree_saver.serialize(exportable, tree)
- end
+ relation_tree_saver.serialize(exportable, tree)
end
end
end
diff --git a/spec/lib/gitlab/import_export/project/legacy_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project/legacy_tree_saver_spec.rb
index d4406dbc60b..e51f6888bbb 100644
--- a/spec/lib/gitlab/import_export/project/legacy_tree_saver_spec.rb
+++ b/spec/lib/gitlab/import_export/project/legacy_tree_saver_spec.rb
@@ -25,51 +25,6 @@ describe Gitlab::ImportExport::Project::LegacyTreeSaver do
expect(project_tree_saver.save).to be true
end
- context ':export_fast_serialize feature flag checks' do
- before do
- expect(Gitlab::ImportExport::Reader).to receive(:new).with(shared: shared).and_return(reader)
- expect(reader).to receive(:project_tree).and_return(project_tree)
- end
-
- let(:serializer) { instance_double('Gitlab::ImportExport::FastHashSerializer') }
- let(:reader) { instance_double('Gitlab::ImportExport::Reader') }
- let(:project_tree) do
- {
- include: [{ issues: { include: [] } }],
- preload: { issues: nil }
- }
- end
-
- context 'when :export_fast_serialize feature is enabled' do
- before do
- stub_feature_flags(export_fast_serialize: true)
- end
-
- it 'uses FastHashSerializer' do
- expect(Gitlab::ImportExport::FastHashSerializer)
- .to receive(:new)
- .with(project, project_tree)
- .and_return(serializer)
-
- expect(serializer).to receive(:execute)
-
- project_tree_saver.save
- end
- end
-
- context 'when :export_fast_serialize feature is disabled' do
- before do
- stub_feature_flags(export_fast_serialize: false)
- end
-
- it 'is serialized via built-in `as_json`' do
- expect(project).to receive(:as_json).with(project_tree)
-
- project_tree_saver.save
- end
- end
- end
-
# It is mostly duplicated in
# `spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb`
# except: