summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-05 14:00:13 +0000
committerDouwe Maan <douwe@gitlab.com>2016-01-05 14:00:13 +0000
commit2479af4d5a67fb91ee05e691a27d0548ab4e80ea (patch)
tree9545fd4212d5b669d3ed54be39876b54e7945a06
parenta7c424515c78ef98f86804d5257e7283531f53ee (diff)
parent12ce1cbfcfff3e28cae82d327b056644457f65f6 (diff)
downloadgitlab-ce-2479af4d5a67fb91ee05e691a27d0548ab4e80ea.tar.gz
Merge branch 'pr-9938' into 'master'
Merge pull request GH-9938 from huacnlee/hotfix/note_mail_with_notification Hotfix note mail with notification See merge request !2288
-rw-r--r--app/mailers/emails/notes.rb2
-rw-r--r--spec/services/notification_service_spec.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index 65f37e92677..e1382d2da12 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -48,7 +48,7 @@ module Emails
yield
- SentNotification.record(@note, recipient_id, reply_key)
+ SentNotification.record_note(@note, recipient_id, reply_key)
end
end
end
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 588ecc51382..b5c7b01357a 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -52,6 +52,9 @@ describe NotificationService, services: true do
it do
add_users_with_subscription(note.project, issue)
+ # Ensure create SentNotification by noteable = issue 6 times, not noteable = note
+ expect(SentNotification).to receive(:record).with(issue, any_args).exactly(6).times
+
ActionMailer::Base.deliveries.clear
notification.new_note(note)