summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-25 09:04:22 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-25 09:04:22 +0200
commit72b13cc1be8dee112337674e20f3147c31934304 (patch)
treef6ae1844cbf13d09cfaf55497d6efba49e54f613 /spec
parentbbca0351f7028f52900ef0855615821b03a2c3f7 (diff)
parent3d8ecbc94fd7ca0583b8a14f6ddd9be92be40c41 (diff)
downloadgitlab-ce-72b13cc1be8dee112337674e20f3147c31934304.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
Diffstat (limited to 'spec')
-rw-r--r--spec/services/notification_service_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 59c17d6e4d7..fbd73a7086f 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -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