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
7e34a19f
Commit
7e34a19f
authored
Jul 05, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check whether new service created from template is valid after unflagging it as a template
parent
3f784d8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/models/service.rb
app/models/service.rb
+1
-1
spec/models/service_spec.rb
spec/models/service_spec.rb
+1
-1
No files found.
app/models/service.rb
View file @
7e34a19f
...
@@ -281,9 +281,9 @@ class Service < ActiveRecord::Base
...
@@ -281,9 +281,9 @@ class Service < ActiveRecord::Base
def
self
.
build_from_template
(
project_id
,
template
)
def
self
.
build_from_template
(
project_id
,
template
)
service
=
template
.
dup
service
=
template
.
dup
service
.
active
=
false
unless
service
.
valid?
service
.
template
=
false
service
.
template
=
false
service
.
project_id
=
project_id
service
.
project_id
=
project_id
service
.
active
=
false
if
service
.
active?
&&
!
service
.
valid?
service
service
end
end
...
...
spec/models/service_spec.rb
View file @
7e34a19f
...
@@ -78,7 +78,7 @@ describe Service do
...
@@ -78,7 +78,7 @@ describe Service do
context
'when template is invalid'
do
context
'when template is invalid'
do
it
'sets service template to inactive when template is invalid'
do
it
'sets service template to inactive when template is invalid'
do
project
=
create
(
:project
)
project
=
create
(
:project
)
template
=
Jira
Service
.
new
(
template:
true
,
active:
true
)
template
=
Kubernetes
Service
.
new
(
template:
true
,
active:
true
)
template
.
save
(
validate:
false
)
template
.
save
(
validate:
false
)
service
=
described_class
.
build_from_template
(
project
.
id
,
template
)
service
=
described_class
.
build_from_template
(
project
.
id
,
template
)
...
...
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