diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-03-08 18:39:38 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-03-11 08:04:48 +0100 |
commit | 5bc216946df04da88d4907bad1833affd9ca0654 (patch) | |
tree | 1b5ea136f6b6d2063a183bfc19b07844a5a9023f /spec/requests/api/internal_spec.rb | |
parent | 8a59c9fdba4572cdfd60be6630d96fd37dc35654 (diff) | |
download | gitlab-ce-5bc216946df04da88d4907bad1833affd9ca0654.tar.gz |
Add spec for `/api/internal/discover` without user
The behavior for GitLab shell calling `/discover` when a user is not
found is currently untested.
We are relying on this behaviour to make GitLab reply "Welcome to
GitLab, Anonymous!".
Diffstat (limited to 'spec/requests/api/internal_spec.rb')
-rw-r--r-- | spec/requests/api/internal_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index cd85151ec1b..52ce4d66b4a 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -237,6 +237,14 @@ describe API::Internal do expect(json_response['name']).to eq(user.name) end + + it 'responds successfully when a user is not found' do + get(api("/internal/discover"), params: { username: 'noone', secret_token: secret_token }) + + expect(response).to have_gitlab_http_status(200) + + expect(response.body).to eq('null') + end end describe "GET /internal/authorized_keys" do |