diff options
author | Wei-Meng Lee <1081658-weimeng@users.noreply.gitlab.com> | 2019-05-31 10:31:28 +0000 |
---|---|---|
committer | Wei-Meng Lee <wlee@gitlab.com> | 2019-05-31 20:49:27 +0800 |
commit | ddb0344a8ff43555061a0775875ea38cbebf7c52 (patch) | |
tree | 1afc8761c470b000f85c696a012cdff4ee318e3a | |
parent | ddd6f804576e1e9d69db85242a8dbc687cdb35db (diff) | |
download | gitlab-ce-weimeng-email-routing.tar.gz |
Apply reviewer suggestionsweimeng-email-routing
-rw-r--r-- | app/mailers/notify.rb | 2 | ||||
-rw-r--r-- | doc/workflow/notifications.md | 2 | ||||
-rw-r--r-- | spec/support/shared_examples/notify_shared_examples.rb | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index cc27ba0c5cc..576caea4c10 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -88,7 +88,7 @@ class Notify < BaseMailer # Return group-specific email address if present, otherwise return global # email address - group_notification_email.presence || @current_user.notification_email + group_notification_email || @current_user.notification_email end # Formats arguments into a String suitable for use as an email subject diff --git a/doc/workflow/notifications.md b/doc/workflow/notifications.md index 6f470863ed8..5d560f2e000 100644 --- a/doc/workflow/notifications.md +++ b/doc/workflow/notifications.md @@ -23,7 +23,7 @@ Each of these settings have levels of notification: - Disabled: Turns off notifications. - Custom: Receive notifications for custom selected events. -> Introduced in GitLab 11.9 +> Introduced in GitLab 12.0 You can also select an email address to receive notifications for each group you belong to. diff --git a/spec/support/shared_examples/notify_shared_examples.rb b/spec/support/shared_examples/notify_shared_examples.rb index bcb30a86727..897c9106d77 100644 --- a/spec/support/shared_examples/notify_shared_examples.rb +++ b/spec/support/shared_examples/notify_shared_examples.rb @@ -60,10 +60,9 @@ shared_examples 'an email sent to a user' do end end - context 'when project is in a sub-group' do + context 'when project is in a sub-group', :nested_groups do before do - project.group = subgroup - project.save! + project.update!(group: subgroup) end it 'is sent to user\'s subgroup notification email address when set' do |