Commit a0815832 authored by Mark Chao's avatar Mark Chao

Merge branch '257438-fix-git-http-spec-kwargs-deprecation' into 'master'

Fix Ruby 2.7 deprecation warnings in spec/requests/git_http_spec.rb

See merge request gitlab-org/gitlab!47892
parents 0d492776 5e89032f
......@@ -433,7 +433,7 @@ RSpec.describe 'Git HTTP requests' do
let(:path) { "#{redirect.path}.git" }
it 'downloads get status 200 for redirects' do
clone_get(path, {})
clone_get(path)
expect(response).to have_gitlab_http_status(:ok)
end
......@@ -465,7 +465,7 @@ RSpec.describe 'Git HTTP requests' do
path: "/#{path}/info/refs?service=git-upload-pack"
})
clone_get(path, env)
clone_get(path, **env)
expect(response).to have_gitlab_http_status(:forbidden)
end
......@@ -493,7 +493,7 @@ RSpec.describe 'Git HTTP requests' do
it "rejects pulls with 401 Unauthorized for unknown projects (no project existence information leak)" do
user.block
download('doesnt/exist.git', env) do |response|
download('doesnt/exist.git', **env) do |response|
expect(response).to have_gitlab_http_status(:unauthorized)
end
end
......@@ -693,7 +693,7 @@ RSpec.describe 'Git HTTP requests' do
end
it 'downloads get status 200' do
clone_get(path, env)
clone_get(path, **env)
expect(response).to have_gitlab_http_status(:ok)
end
......@@ -745,7 +745,7 @@ RSpec.describe 'Git HTTP requests' do
# We know for sure it is not an information leak since pulls using
# the build token must be allowed.
it "rejects pushes with 403 Forbidden" do
push_get(path, env)
push_get(path, **env)
expect(response).to have_gitlab_http_status(:forbidden)
expect(response.body).to eq(git_access_error(:auth_upload))
......@@ -754,7 +754,7 @@ RSpec.describe 'Git HTTP requests' do
# We are "authenticated" as CI using a valid token here. But we are
# not authorized to see any other project, so return "not found".
it "rejects pulls for other project with 404 Not Found" do
clone_get("#{other_project.full_path}.git", env)
clone_get("#{other_project.full_path}.git", **env)
expect(response).to have_gitlab_http_status(:not_found)
expect(response.body).to eq(git_access_error(:project_not_found))
......@@ -777,7 +777,7 @@ RSpec.describe 'Git HTTP requests' do
let(:project) { create(:project) }
it 'rejects pulls with 404 Not Found' do
clone_get path, env
clone_get(path, **env)
expect(response).to have_gitlab_http_status(:not_found)
expect(response.body).to eq(git_access_error(:no_repo))
......@@ -785,7 +785,7 @@ RSpec.describe 'Git HTTP requests' do
end
it 'rejects pushes with 403 Forbidden' do
push_get path, env
push_get(path, **env)
expect(response).to have_gitlab_http_status(:forbidden)
expect(response.body).to eq(git_access_error(:auth_upload))
......@@ -889,7 +889,7 @@ RSpec.describe 'Git HTTP requests' do
end
it "responds with status 200" do
clone_get(path, env) do |response|
clone_get(path, **env) do |response|
expect(response).to have_gitlab_http_status(:ok)
end
end
......@@ -913,7 +913,7 @@ RSpec.describe 'Git HTTP requests' do
end
it 'blocks git access when the user did not accept terms', :aggregate_failures do
clone_get(path, env) do |response|
clone_get(path, **env) do |response|
expect(response).to have_gitlab_http_status(:forbidden)
end
......@@ -932,7 +932,7 @@ RSpec.describe 'Git HTTP requests' do
end
it 'allows clones' do
clone_get(path, env) do |response|
clone_get(path, **env) do |response|
expect(response).to have_gitlab_http_status(:ok)
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