summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 09:07:58 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 09:07:58 +0000
commit45b4df3e57c949c88107840c44ccbfaf2eabdf26 (patch)
treef73c1533a75b03d2ceb1361644e0d8ab97568a8f /spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb
parent7421e6f9f2b5889b05738af7eba568af6ae3fcbc (diff)
downloadgitlab-ce-45b4df3e57c949c88107840c44ccbfaf2eabdf26.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb')
-rw-r--r--spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb34
1 files changed, 8 insertions, 26 deletions
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