Commit 5bc21694 authored by Bob Van Landuyt's avatar Bob Van Landuyt

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!".
parent 8a59c9fd
...@@ -237,6 +237,14 @@ describe API::Internal do ...@@ -237,6 +237,14 @@ describe API::Internal do
expect(json_response['name']).to eq(user.name) expect(json_response['name']).to eq(user.name)
end 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 end
describe "GET /internal/authorized_keys" do describe "GET /internal/authorized_keys" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment