diff options
Diffstat (limited to 'spec/lib/gitlab/gitaly_client_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gitaly_client_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb index 65177c627f3..74831197bfb 100644 --- a/spec/lib/gitlab/gitaly_client_spec.rb +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -28,6 +28,24 @@ describe Gitlab::GitalyClient, skip_gitaly_mock: true do end end + describe '.stub_creds' do + it 'returns :this_channel_is_insecure if tcp' do + address = 'tcp://localhost:9876' + allow(Gitlab.config.repositories).to receive(:storages).and_return({ + 'default' => { 'gitaly_address' => address } + }) + expect(described_class.stub_creds('default')).to eq(:this_channel_is_insecure) + end + + it 'returns Credentials object if tls' do + address = 'tls://localhost:9876' + allow(Gitlab.config.repositories).to receive(:storages).and_return({ + 'default' => { 'gitaly_address' => address } + }) + expect(described_class.stub_creds('default')).to be_a(GRPC::Core::ChannelCredentials) + end + end + describe '.stub' do # Notice that this is referring to gRPC "stubs", not rspec stubs before do |