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
7696191e
Commit
7696191e
authored
Apr 18, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disables test settings on chat notification services when repository is empty
parent
554d2974
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
app/models/project_services/chat_notification_service.rb
app/models/project_services/chat_notification_service.rb
+1
-1
changelogs/unreleased/31009-disable-test-settings-on-services-when-repository-is-empty.yml
...le-test-settings-on-services-when-repository-is-empty.yml
+4
-0
spec/models/project_services/chat_notification_service_spec.rb
...models/project_services/chat_notification_service_spec.rb
+19
-1
No files found.
app/models/project_services/chat_notification_service.rb
View file @
7696191e
...
...
@@ -22,7 +22,7 @@ class ChatNotificationService < Service
end
def
can_test?
valid?
super
&&
valid?
end
def
self
.
supported_events
...
...
changelogs/unreleased/31009-disable-test-settings-on-services-when-repository-is-empty.yml
0 → 100644
View file @
7696191e
---
title
:
Disable test settings on chat notification services when repository is empty
merge_request
:
10759
author
:
spec/models/project_services/chat_notification_service_spec.rb
View file @
7696191e
require
'spec_helper'
describe
ChatNotificationService
,
models:
true
do
describe
"Associations"
do
describe
'Associations'
do
before
do
allow
(
subject
).
to
receive
(
:activated?
).
and_return
(
true
)
end
it
{
is_expected
.
to
validate_presence_of
:webhook
}
end
describe
'#can_test?'
do
context
'with empty repository'
do
it
'returns false'
do
subject
.
project
=
create
(
:empty_project
,
:empty_repo
)
expect
(
subject
.
can_test?
).
to
be
false
end
end
context
'with repository'
do
it
'returns true'
do
subject
.
project
=
create
(
:project
)
expect
(
subject
.
can_test?
).
to
be
true
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