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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
72b13cc1
Commit
72b13cc1
authored
Mar 25, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
bbca0351
3d8ecbc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
app/services/notification_service.rb
app/services/notification_service.rb
+1
-0
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+8
-0
No files found.
app/services/notification_service.rb
View file @
72b13cc1
...
...
@@ -111,6 +111,7 @@ class NotificationService
# ignore gitlab service messages
return
true
if
note
.
note
=~
/\A_Status changed to closed_/
return
true
if
note
.
note
=~
/\A_mentioned in /
&&
note
.
system
==
true
opts
=
{
noteable_type:
note
.
noteable_type
,
project_id:
note
.
project_id
}
...
...
spec/services/notification_service_spec.rb
View file @
72b13cc1
...
...
@@ -32,6 +32,7 @@ describe NotificationService do
describe
'Notes'
do
context
'issue note'
do
let
(
:issue
)
{
create
(
:issue
,
assignee:
create
(
:user
))
}
let
(
:mentioned_issue
)
{
create
(
:issue
,
assignee:
issue
.
assignee
)
}
let
(
:note
)
{
create
(
:note_on_issue
,
noteable:
issue
,
project_id:
issue
.
project_id
,
note:
'@mention referenced'
)
}
before
do
...
...
@@ -50,6 +51,13 @@ describe NotificationService do
notification
.
new_note
(
note
)
end
it
'filters out "mentioned in" notes'
do
mentioned_note
=
Note
.
create_cross_reference_note
(
mentioned_issue
,
issue
,
issue
.
author
,
issue
.
project
)
Notify
.
should_not_receive
(
:note_issue_email
)
notification
.
new_note
(
mentioned_note
)
end
def
should_email
(
user_id
)
Notify
.
should_receive
(
:note_issue_email
).
with
(
user_id
,
note
.
id
)
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