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
4974f1ef
Commit
4974f1ef
authored
Aug 03, 2017
by
haseeb
Committed by
Rémy Coutable
Aug 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #3686 make tarball download url to end with extension
parent
29f1fa82
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
changelogs/unreleased/3686_make_tarball_download_url.yml
changelogs/unreleased/3686_make_tarball_download_url.yml
+4
-0
config/routes/repository.rb
config/routes/repository.rb
+1
-1
spec/controllers/projects/repositories_controller_spec.rb
spec/controllers/projects/repositories_controller_spec.rb
+1
-1
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+7
-3
No files found.
changelogs/unreleased/3686_make_tarball_download_url.yml
0 → 100644
View file @
4974f1ef
---
title
:
repository archive download url now ends with selected file extension
merge_request
:
13178
author
:
haseebeqx
config/routes/repository.rb
View file @
4974f1ef
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
resource
:repository
,
only:
[
:create
]
do
resource
:repository
,
only:
[
:create
]
do
member
do
member
do
get
'
archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
}
get
'
:ref/archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
,
ref:
/.+/
},
action:
'archive'
,
as:
'archive'
end
end
end
end
...
...
spec/controllers/projects/repositories_controller_spec.rb
View file @
4974f1ef
...
@@ -6,7 +6,7 @@ describe Projects::RepositoriesController do
...
@@ -6,7 +6,7 @@ describe Projects::RepositoriesController do
describe
"GET archive"
do
describe
"GET archive"
do
context
'as a guest'
do
context
'as a guest'
do
it
'responds with redirect in correct format'
do
it
'responds with redirect in correct format'
do
get
:archive
,
namespace_id:
project
.
namespace
,
project_id:
project
,
format:
"zip"
get
:archive
,
namespace_id:
project
.
namespace
,
project_id:
project
,
format:
"zip"
,
ref:
'master'
expect
(
response
.
header
[
"Content-Type"
]).
to
start_with
(
'text/html'
)
expect
(
response
.
header
[
"Content-Type"
]).
to
start_with
(
'text/html'
)
expect
(
response
).
to
be_redirect
expect
(
response
).
to
be_redirect
...
...
spec/routing/project_routing_spec.rb
View file @
4974f1ef
...
@@ -165,15 +165,19 @@ describe 'project routing' do
...
@@ -165,15 +165,19 @@ describe 'project routing' do
# edit_project_repository GET /:project_id/repository/edit(.:format) projects/repositories#edit
# edit_project_repository GET /:project_id/repository/edit(.:format) projects/repositories#edit
describe
Projects
::
RepositoriesController
,
'routing'
do
describe
Projects
::
RepositoriesController
,
'routing'
do
it
'to #archive'
do
it
'to #archive'
do
expect
(
get
(
'/gitlab/gitlabhq/repository/
archive'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq
'
)
expect
(
get
(
'/gitlab/gitlabhq/repository/
master/archive'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
ref:
'master
'
)
end
end
it
'to #archive format:zip'
do
it
'to #archive format:zip'
do
expect
(
get
(
'/gitlab/gitlabhq/repository/
archive.zip'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
format:
'zip
'
)
expect
(
get
(
'/gitlab/gitlabhq/repository/
master/archive.zip'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
format:
'zip'
,
ref:
'master
'
)
end
end
it
'to #archive format:tar.bz2'
do
it
'to #archive format:tar.bz2'
do
expect
(
get
(
'/gitlab/gitlabhq/repository/archive.tar.bz2'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
format:
'tar.bz2'
)
expect
(
get
(
'/gitlab/gitlabhq/repository/master/archive.tar.bz2'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
format:
'tar.bz2'
,
ref:
'master'
)
end
it
'to #archive with "/" in route'
do
expect
(
get
(
'/gitlab/gitlabhq/repository/improve/awesome/archive'
)).
to
route_to
(
'projects/repositories#archive'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
ref:
'improve/awesome'
)
end
end
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