diff options
author | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-10-31 15:24:31 +0300 |
---|---|---|
committer | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-10-31 16:20:39 +0300 |
commit | b8ab35d6fedea6e93c755d5a805f13de8b8793a7 (patch) | |
tree | 1fc70559dceed3e914acde9e52332bf7bc2046c4 /spec/lib/gitlab/gitaly_client_spec.rb | |
parent | c6979035c114b40e3b49f5ff3572cdf5fe19bb0b (diff) |
Add gitaly client specs
Diffstat (limited to 'spec/lib/gitlab/gitaly_client_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gitaly_client_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb index 81bcd8c28ed..65177c627f3 100644 --- a/spec/lib/gitlab/gitaly_client_spec.rb +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -47,6 +47,21 @@ describe Gitlab::GitalyClient, skip_gitaly_mock: true do end end + context 'when passed a TLS address' do + it 'strips tls:// prefix before passing it to GRPC::Core::Channel initializer' do + address = 'localhost:9876' + prefixed_address = "tls://#{address}" + + allow(Gitlab.config.repositories).to receive(:storages).and_return({ + 'default' => { 'gitaly_address' => prefixed_address } + }) + + expect(Gitaly::CommitService::Stub).to receive(:new).with(address, any_args) + + described_class.stub(:commit_service, 'default') + end + end + context 'when passed a TCP address' do it 'strips tcp:// prefix before passing it to GRPC::Core::Channel initializer' do address = 'localhost:9876' |