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

remote_service_spec.rb « gitaly_server « lib « spec « ruby - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 511b4f008780764c5f6c82946c7aad06e5459474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

describe GitalyServer::RemoteService do
  describe '#update_remote_mirror' do
    it 'assigns a limited number of divergent refs' do
      stub_const("#{described_class}::DIVERGENT_REF_LIMIT", 2)

      mirror = double(
        divergent_refs: %w[refs/heads/master refs/heads/develop refs/heads/stable]
      ).as_null_object
      stub_const('Gitlab::Git::RemoteMirror', mirror)

      call = double(to_a: [], to_ary: []).as_null_object
      response = described_class.new.update_remote_mirror(call)

      expect(response.divergent_refs).to eq(%w[refs/heads/master refs/heads/develop])
    end
  end
end