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
67974f1d
Commit
67974f1d
authored
Apr 25, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove invalid services
parent
3ff8d802
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
app/models/service.rb
app/models/service.rb
+1
-0
spec/models/service_spec.rb
spec/models/service_spec.rb
+4
-0
No files found.
app/models/service.rb
View file @
67974f1d
...
@@ -26,6 +26,7 @@ class Service < ActiveRecord::Base
...
@@ -26,6 +26,7 @@ class Service < ActiveRecord::Base
has_one
:service_hook
has_one
:service_hook
validates
:project_id
,
presence:
true
,
unless:
proc
{
|
service
|
service
.
template?
}
validates
:project_id
,
presence:
true
,
unless:
proc
{
|
service
|
service
.
template?
}
validates
:type
,
presence:
true
scope
:visible
,
->
{
where
.
not
(
type:
'GitlabIssueTrackerService'
)
}
scope
:visible
,
->
{
where
.
not
(
type:
'GitlabIssueTrackerService'
)
}
scope
:issue_trackers
,
->
{
where
(
category:
'issue_tracker'
)
}
scope
:issue_trackers
,
->
{
where
(
category:
'issue_tracker'
)
}
...
...
spec/models/service_spec.rb
View file @
67974f1d
...
@@ -6,6 +6,10 @@ describe Service, models: true do
...
@@ -6,6 +6,10 @@ describe Service, models: true do
it
{
is_expected
.
to
have_one
:service_hook
}
it
{
is_expected
.
to
have_one
:service_hook
}
end
end
describe
'Validations'
do
it
{
is_expected
.
to
validate_presence_of
(
:type
).
on
(
:create
)
}
end
describe
"Test Button"
do
describe
"Test Button"
do
before
do
before
do
@service
=
Service
.
new
@service
=
Service
.
new
...
...
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