diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-08 00:07:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-08 00:07:54 +0300 |
commit | 8c8b94e7116fa478ad490bd14c09565d23097f57 (patch) | |
tree | 9e4637aa0fe498a5523c86932b87ff691ec72af6 /spec/lib/gitlab/gitaly_client | |
parent | eadb77d89f5f7d445bfd326f18873168f4719f12 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/gitaly_client')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/storage_settings_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb b/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb index f2f53982b09..2f83e5a5221 100644 --- a/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb +++ b/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb @@ -27,6 +27,38 @@ describe Gitlab::GitalyClient::StorageSettings do end end + describe '.gitaly_address' do + context 'when the storage settings have no gitaly address but one is requested' do + it 'raises an error' do + expect do + described_class.new("path" => Rails.root).gitaly_address + end.to raise_error("key not found: \"gitaly_address\"") + end + end + + context 'when the storage settings have a gitaly address and one is requested' do + it 'returns the setting value' do + expect(described_class.new("path" => Rails.root, "gitaly_address" => "test").gitaly_address).to eq("test") + end + end + + context 'when the storage settings have a gitaly address keyed symbolically' do + it 'raises no error' do + expect do + described_class.new("path" => Rails.root, :gitaly_address => "test").gitaly_address + end.not_to raise_error + end + end + + context 'when the storage settings have a gitaly address keyed with a string' do + it 'raises no error' do + expect do + described_class.new("path" => Rails.root, "gitaly_address" => "test").gitaly_address + end.not_to raise_error + end + end + end + describe '.disk_access_denied?' do context 'when Rugged is enabled', :enable_rugged do it 'returns false' do |