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
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
app/services/projects/create_from_template_service.rb
app/services/projects/create_from_template_service.rb
+2
-1
changelogs/unreleased/fj-42601-respect-visibility-options.yml
...gelogs/unreleased/fj-42601-respect-visibility-options.yml
+5
-0
spec/services/projects/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
...
@@ -8,9 +8,10 @@ module Projects
template_name
=
params
.
delete
(
:template_name
)
template_name
=
params
.
delete
(
:template_name
)
file
=
Gitlab
::
ProjectTemplate
.
find
(
template_name
).
file
file
=
Gitlab
::
ProjectTemplate
.
find
(
template_name
).
file
override_params
=
params
.
dup
params
[
:file
]
=
file
params
[
:file
]
=
file
GitlabProjectsImportService
.
new
(
current_user
,
params
).
execute
GitlabProjectsImportService
.
new
(
current_user
,
params
,
override_params
).
execute
ensure
ensure
file
&
.
close
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
...
@@ -7,7 +7,7 @@ describe Projects::CreateFromTemplateService do
path:
user
.
to_param
,
path:
user
.
to_param
,
template_name:
'rails'
,
template_name:
'rails'
,
description:
'project description'
,
description:
'project description'
,
visibility_level:
Gitlab
::
VisibilityLevel
::
P
RIVATE
visibility_level:
Gitlab
::
VisibilityLevel
::
P
UBLIC
}
}
end
end
...
@@ -24,7 +24,23 @@ describe Projects::CreateFromTemplateService do
...
@@ -24,7 +24,23 @@ describe Projects::CreateFromTemplateService do
expect
(
project
).
to
be_saved
expect
(
project
).
to
be_saved
expect
(
project
.
scheduled?
).
to
be
(
true
)
expect
(
project
.
scheduled?
).
to
be
(
true
)
expect
(
project
.
description
).
to
match
(
'project description'
)
end
expect
(
project
.
visibility_level
).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
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
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