Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2019-03-08 20:39:38 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2019-03-11 10:04:48 +0300
commit5bc216946df04da88d4907bad1833affd9ca0654 (patch)
tree1b5ea136f6b6d2063a183bfc19b07844a5a9023f
parent8a59c9fdba4572cdfd60be6630d96fd37dc35654 (diff)
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!".
-rw-r--r--spec/requests/api/internal_spec.rb8
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