diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-08-03 00:43:51 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-08-03 21:55:48 +0800 |
commit | bb5f79d43e0bb20bacd5ecd8b66832d9857bd079 (patch) | |
tree | b480f8496e3e93e5a845e4a710e2d46901871413 /spec/services/notification_service_spec.rb | |
parent | b0464fa4e19e187adc46ec054ccd68832faec08c (diff) | |
download | gitlab-ce-bb5f79d43e0bb20bacd5ecd8b66832d9857bd079.tar.gz |
Don't include EmailHelpers manually, pick with rspecuse-rspec-support-helper
`:mailer` is needed to pick it easily, while
`type: :mailer` is needed for picking it automatically for
tests located in spec/mailers/*_spec.rb
It's a bit complicated in spec/services/notification_service_spec.rb
but we'll leave it alone for now.
Diffstat (limited to 'spec/services/notification_service_spec.rb')
-rw-r--r-- | spec/services/notification_service_spec.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 882ee7751b5..5354591642b 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' -describe NotificationService do - include EmailHelpers - +describe NotificationService, :mailer do let(:notification) { described_class.new } let(:assignee) { create(:user) } @@ -14,7 +12,6 @@ describe NotificationService do shared_examples 'notifications for new mentions' do def send_notifications(*new_mentions) - reset_delivered_emails! notification.send(notification_method, mentionable, new_mentions, @u_disabled) end @@ -137,12 +134,11 @@ describe NotificationService do describe '#new_note' do it do add_users_with_subscription(note.project, issue) + reset_delivered_emails! # Ensure create SentNotification by noteable = issue 6 times, not noteable = note expect(SentNotification).to receive(:record).with(issue, any_args).exactly(8).times - reset_delivered_emails! - notification.new_note(note) should_email(@u_watcher) @@ -165,9 +161,10 @@ describe NotificationService do it "emails the note author if they've opted into notifications about their activity" do add_users_with_subscription(note.project, issue) - note.author.notified_of_own_activity = true reset_delivered_emails! + note.author.notified_of_own_activity = true + notification.new_note(note) should_email(note.author) |