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
b4720bf7
Commit
b4720bf7
authored
Apr 28, 2020
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept dots in project name in project templates endpoint
parent
6f1d54d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
lib/api/project_templates.rb
lib/api/project_templates.rb
+1
-1
spec/requests/api/project_templates_spec.rb
spec/requests/api/project_templates_spec.rb
+7
-1
No files found.
lib/api/project_templates.rb
View file @
b4720bf7
...
...
@@ -12,7 +12,7 @@ module API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:type
,
type:
String
,
values:
TEMPLATE_TYPES
,
desc:
'The type (dockerfiles|gitignores|gitlab_ci_ymls|licenses) of the template'
end
resource
:projects
do
resource
:projects
,
requirements:
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
do
desc
'Get a list of templates available to this project'
do
detail
'This endpoint was introduced in GitLab 11.4'
end
...
...
spec/requests/api/project_templates_spec.rb
View file @
b4720bf7
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
API
::
ProjectTemplates
do
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
,
path:
'path.with.dot'
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:private
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
...
...
@@ -12,6 +12,12 @@ describe API::ProjectTemplates do
end
describe
'GET /projects/:id/templates/:type'
do
it
'accepts project paths with dots'
do
get
api
(
"/projects/
#{
public_project
.
namespace
.
path
}
%2F
#{
public_project
.
path
}
/templates/dockerfiles"
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
it
'returns dockerfiles'
do
get
api
(
"/projects/
#{
public_project
.
id
}
/templates/dockerfiles"
)
...
...
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