summaryrefslogtreecommitdiff
path: root/spec/requests/api/internal_spec.rb
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-01-16 17:52:52 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-01-19 21:58:06 -0300
commit81dd626b9b09550983e7c3ba4aba1420e870e49b (patch)
tree11f8cdc10ca1026b78b449a8fbff9145153fbc4d /spec/requests/api/internal_spec.rb
parentcf1f7e89c9d948a96a1c637183a1c1f076fda27c (diff)
downloadgitlab-ce-gitaly-api.tar.gz
Add internal API endpoint to share Gitaly's paths with other componentsgitaly-api
Diffstat (limited to 'spec/requests/api/internal_spec.rb')
-rw-r--r--spec/requests/api/internal_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index a3798c8cd6c..b8881cbe815 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -412,6 +412,20 @@ describe API::Internal, api: true do
end
end
+ describe 'GET /internal/gitaly' do
+ before do
+ allow(Gitlab.config).to receive(:gitaly).and_return(Settingslogic.new('socket_path' => '/my/gitaly.socket'))
+
+ get api("/internal/gitaly"), secret_token: secret_token
+ end
+
+ it 'returns the gitaly socket path' do
+ expect(response.status).to eq(200)
+
+ expect(json_response['socket_path']).to eq('/my/gitaly.socket')
+ end
+ end
+
def project_with_repo_path(path)
double().tap do |fake_project|
allow(fake_project).to receive_message_chain('repository.path_to_repo' => path)