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

legacy_relation_tree_saver_spec.rb « import_export « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0d372def8b0066762bade608385006ad886f5ec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::ImportExport::LegacyRelationTreeSaver do
  let(:exportable) { create(:group) }
  let(:relation_tree_saver) { described_class.new }
  let(:tree) { {} }

  describe '#serialize' do
    let(:serializer) { instance_double(Gitlab::ImportExport::FastHashSerializer) }

    it 'uses FastHashSerializer' do
      expect(Gitlab::ImportExport::FastHashSerializer)
        .to receive(:new)
        .with(exportable, tree, batch_size: Gitlab::ImportExport::Json::StreamingSerializer::BATCH_SIZE)
        .and_return(serializer)

      expect(serializer).to receive(:execute)

      relation_tree_saver.serialize(exportable, tree)
    end
  end
end