1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GitalyClient::BlobService do
let(:project) { create(:project, :repository) }
let(:storage_name) { project.repository_storage }
let(:relative_path) { project.disk_path + '.git' }
let(:repository) { project.repository }
let(:client) { described_class.new(repository) }
describe '#get_new_lfs_pointers' do
let(:revision) { 'master' }
let(:limit) { 5 }
let(:not_in) { ['branch-a', 'branch-b'] }
let(:expected_params) do
{ revision: revision, limit: limit, not_in_refs: not_in, not_in_all: false }
end
subject { client.get_new_lfs_pointers(revision, limit, not_in) }
it 'sends a get_new_lfs_pointers message' do
expect_any_instance_of(Gitaly::BlobService::Stub)
.to receive(:get_new_lfs_pointers)
.with(gitaly_request_with_params(expected_params), kind_of(Hash))
.and_return([])
subject
end
context 'with not_in = :all' do
let(:not_in) { :all }
let(:expected_params) do
{ revision: revision, limit: limit, not_in_refs: [], not_in_all: true }
end
it 'sends the correct message' do
expect_any_instance_of(Gitaly::BlobService::Stub)
.to receive(:get_new_lfs_pointers)
.with(gitaly_request_with_params(expected_params), kind_of(Hash))
.and_return([])
subject
end
end
end
describe '#get_all_lfs_pointers' do
let(:revision) { 'master' }
subject { client.get_all_lfs_pointers(revision) }
it 'sends a get_all_lfs_pointers message' do
expect_any_instance_of(Gitaly::BlobService::Stub)
.to receive(:get_all_lfs_pointers)
.with(gitaly_request_with_params(revision: revision), kind_of(Hash))
.and_return([])
subject
end
end
end
|