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
Jérome Perrin
gitlab-ce
Commits
fc94b3b0
Commit
fc94b3b0
authored
Oct 14, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix API archive specs
parent
033a879c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
spec/requests/api/repositories_spec.rb
spec/requests/api/repositories_spec.rb
+3
-6
No files found.
spec/requests/api/repositories_spec.rb
View file @
fc94b3b0
...
...
@@ -166,24 +166,21 @@ describe API::API, api: true do
get
api
(
"/projects/
#{
project
.
id
}
/repository/archive"
,
user
)
repo_name
=
project
.
repository
.
name
.
gsub
(
"
\.
git"
,
""
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
headers
[
'Content-Disposition'
]).
to
match
(
/filename\=\"
#{
repo_name
}
\-[^\.]+\.tar.gz\"/
)
expect
(
response
.
content_type
).
to
eq
(
MIME
::
Types
.
type_for
(
'file.tar.gz'
).
first
.
content_type
)
expect
(
json_response
[
'ArchivePath'
]).
to
match
(
/
#{
repo_name
}
\-[^\.]+\.tar.gz/
)
end
it
"should get the archive.zip"
do
get
api
(
"/projects/
#{
project
.
id
}
/repository/archive.zip"
,
user
)
repo_name
=
project
.
repository
.
name
.
gsub
(
"
\.
git"
,
""
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
headers
[
'Content-Disposition'
]).
to
match
(
/filename\=\"
#{
repo_name
}
\-[^\.]+\.zip\"/
)
expect
(
response
.
content_type
).
to
eq
(
MIME
::
Types
.
type_for
(
'file.zip'
).
first
.
content_type
)
expect
(
json_response
[
'ArchivePath'
]).
to
match
(
/
#{
repo_name
}
\-[^\.]+\.zip/
)
end
it
"should get the archive.tar.bz2"
do
get
api
(
"/projects/
#{
project
.
id
}
/repository/archive.tar.bz2"
,
user
)
repo_name
=
project
.
repository
.
name
.
gsub
(
"
\.
git"
,
""
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
headers
[
'Content-Disposition'
]).
to
match
(
/filename\=\"
#{
repo_name
}
\-[^\.]+\.tar.bz2\"/
)
expect
(
response
.
content_type
).
to
eq
(
MIME
::
Types
.
type_for
(
'file.tar.bz2'
).
first
.
content_type
)
expect
(
json_response
[
'ArchivePath'
]).
to
match
(
/
#{
repo_name
}
\-[^\.]+\.tar.bz2/
)
end
it
"should return 404 for invalid sha"
do
...
...
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