diff options
Diffstat (limited to 'spec/requests/git_http_spec.rb')
-rw-r--r-- | spec/requests/git_http_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index 1ee3e36be8b..a1e28c18769 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -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 |