Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5e89032f
Commit
5e89032f
authored
Nov 17, 2020
by
Dmitry Gruzd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix git_http_spec kwargs deprecation warning
parent
7891afa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
spec/requests/git_http_spec.rb
spec/requests/git_http_spec.rb
+11
-11
No files found.
spec/requests/git_http_spec.rb
View file @
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment