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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
bf63964b
Commit
bf63964b
authored
Jun 09, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for getting info/refs from repo
parent
df5fb28a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
spec/requests/git_http_spec.rb
spec/requests/git_http_spec.rb
+28
-0
No files found.
spec/requests/git_http_spec.rb
View file @
bf63964b
...
@@ -321,6 +321,34 @@ describe 'Git HTTP requests', lib: true do
...
@@ -321,6 +321,34 @@ describe 'Git HTTP requests', lib: true do
end
end
end
end
context
"retrieving an info/refs file"
do
before
{
project
.
update_attribute
(
:visibility_level
,
Project
::
PUBLIC
)
}
context
"when the file exists"
do
before
do
# Provide a dummy file in its place
allow_any_instance_of
(
Repository
).
to
receive
(
:blob_at
).
and_call_original
allow_any_instance_of
(
Repository
).
to
receive
(
:blob_at
).
with
(
'5937ac0a7beb003549fc5fd26fc247adbce4a52e'
,
'info/refs'
)
do
Gitlab
::
Git
::
Blob
.
find
(
project
.
repository
,
'master'
,
'.gitignore'
)
end
get
"/
#{
project
.
path_with_namespace
}
/blob/master/info/refs"
end
it
"returns the file"
do
expect
(
response
.
status
).
to
eq
(
200
)
end
end
context
"when the file exists"
do
before
{
get
"/
#{
project
.
path_with_namespace
}
/blob/master/info/refs"
}
it
"returns not found"
do
expect
(
response
.
status
).
to
eq
(
404
)
end
end
end
def
clone_get
(
project
,
options
=
{})
def
clone_get
(
project
,
options
=
{})
get
"/
#{
project
}
/info/refs"
,
{
service:
'git-upload-pack'
},
auth_env
(
*
options
.
values_at
(
:user
,
:password
))
get
"/
#{
project
}
/info/refs"
,
{
service:
'git-upload-pack'
},
auth_env
(
*
options
.
values_at
(
:user
,
:password
))
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