diff options
author | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-10-31 14:47:21 +0200 |
---|---|---|
committer | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-10-31 15:43:05 +0200 |
commit | 08a57fe8280ddef66f9c78860a97bf332ceea8d1 (patch) | |
tree | f62db559af93b8004703b46867a820f57351f9aa /spec/lib | |
parent | e2cb9245ea54a1c49ad24e0d8001e1a14902348f (diff) | |
download | gitlab-ce-08a57fe8280ddef66f9c78860a97bf332ceea8d1.tar.gz |
Add more specs
Diffstat (limited to 'spec/lib')
-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 |