diff options
Diffstat (limited to 'spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb b/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb index 076f454895f..30f8280fda3 100644 --- a/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb +++ b/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb @@ -95,4 +95,26 @@ describe Gitlab::ImportExport::JSON::StreamingSerializer do end end end + + describe '.batch_size' do + context 'when export_reduce_relation_batch_size feature flag is enabled' do + before do + stub_feature_flags(export_reduce_relation_batch_size: true) + end + + it 'returns 20' do + expect(described_class.batch_size(exportable)).to eq(described_class::SMALLER_BATCH_SIZE) + end + end + + context 'when export_reduce_relation_batch_size feature flag is disabled' do + before do + stub_feature_flags(export_reduce_relation_batch_size: false) + end + + it 'returns default batch size' do + expect(described_class.batch_size(exportable)).to eq(described_class::BATCH_SIZE) + end + end + end end |