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!".
This commit is contained in:
Bob Van Landuyt 2019-03-08 18:39:38 +01:00
parent 8a59c9fdba
commit 5bc216946d
1 changed files with 8 additions and 0 deletions

View File

@ -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