summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/gitaly_client/storage_settings_spec.rb')
-rw-r--r--spec/lib/gitlab/gitaly_client/storage_settings_spec.rb32
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