summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <me@douwe.me>2016-01-04 12:11:13 +0100
committerRobert Speicher <rspeicher@gmail.com>2016-01-04 13:33:58 -0500
commit12ce1cbfcfff3e28cae82d327b056644457f65f6 (patch)
tree1e74d8fd3704b37cb5e2bf7de14284acdbed1199
parentce4c38b35cca14eb50640e138c5faa354f8d6e72 (diff)
downloadgitlab-ce-pr-9938.tar.gz
Merge pull request GH-9938 from huacnlee/hotfix/note_mail_with_notificationpr-9938
Hotfix note mail with notification
-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 c103752198d..fc8cf425c3a 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)