Commit 7b618f04 authored by Markus Koller's avatar Markus Koller

Add specs for Git HTTP requests without a service parameter

These currently return a 403/401 response, depending on whether the
user was authenticated or not.

We want to verify this behaviour in specs to ensure
backwards-compatibility.
parent cd4be563
......@@ -382,6 +382,14 @@ RSpec.describe 'Git HTTP requests' do
end
end
end
context 'but the service parameter is missing' do
it 'rejects clones with 403 Forbidden' do
get("/#{path}/info/refs", headers: auth_env(*env.values_at(:user, :password), nil))
expect(response).to have_gitlab_http_status(:forbidden)
end
end
end
context 'and not a member of the team' do
......@@ -409,6 +417,14 @@ RSpec.describe 'Git HTTP requests' do
it_behaves_like 'pushes are allowed'
end
context 'but the service parameter is missing' do
it 'rejects clones with 401 Unauthorized' do
get("/#{path}/info/refs")
expect(response).to have_gitlab_http_status(:unauthorized)
end
end
end
end
......
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