BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
92deabb3
Commit
92deabb3
authored
Apr 19, 2018
by
Francisco Javier López
Committed by
Douwe Maan
Apr 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respect visibility options and description when importing project from template
parent
6c868a01
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
create_from_template_service.rb
app/services/projects/create_from_template_service.rb
+2
-1
fj-42601-respect-visibility-options.yml
...gelogs/unreleased/fj-42601-respect-visibility-options.yml
+5
-0
create_from_template_service_spec.rb
spec/services/projects/create_from_template_service_spec.rb
+19
-3
No files found.
app/services/projects/create_from_template_service.rb
View file @
92deabb3
...
...
@@ -8,9 +8,10 @@ module Projects
template_name
=
params
.
delete
(
:template_name
)
file
=
Gitlab
::
ProjectTemplate
.
find
(
template_name
).
file
override_params
=
params
.
dup
params
[
:file
]
=
file
GitlabProjectsImportService
.
new
(
current_user
,
params
).
execute
GitlabProjectsImportService
.
new
(
current_user
,
params
,
override_params
).
execute
ensure
file
&
.
close
...
...
changelogs/unreleased/fj-42601-respect-visibility-options.yml
0 → 100644
View file @
92deabb3
---
title
:
Respect visibility options and description when importing project from template
merge_request
:
18473
author
:
type
:
fixed
spec/services/projects/create_from_template_service_spec.rb
View file @
92deabb3
...
...
@@ -7,7 +7,7 @@ describe Projects::CreateFromTemplateService do
path:
user
.
to_param
,
template_name:
'rails'
,
description:
'project description'
,
visibility_level:
Gitlab
::
VisibilityLevel
::
P
RIVATE
visibility_level:
Gitlab
::
VisibilityLevel
::
P
UBLIC
}
end
...
...
@@ -24,7 +24,23 @@ describe Projects::CreateFromTemplateService do
expect
(
project
).
to
be_saved
expect
(
project
.
scheduled?
).
to
be
(
true
)
expect
(
project
.
description
).
to
match
(
'project description'
)
expect
(
project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
context
'the result project'
do
before
do
Sidekiq
::
Testing
.
inline!
do
@project
=
subject
.
execute
end
@project
.
reload
end
it
'overrides template description'
do
expect
(
@project
.
description
).
to
match
(
'project description'
)
end
it
'overrides template visibility_level'
do
expect
(
@project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PUBLIC
)
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