diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-30 09:11:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-30 09:11:20 +0300 |
commit | 010d26e381cbdd763212ace65e4b1dc7153f44a9 (patch) | |
tree | 4902fdff32fbc4b6bfb01ad1c95ee11a6c70c022 /spec/mailers | |
parent | 322b7f2d405e03f837e6c4e637793aad1fd5fd20 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/notify_spec.rb | 101 |
1 files changed, 38 insertions, 63 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 9df89f84450..21878bc9b6d 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -1512,7 +1512,6 @@ RSpec.describe Notify do context 'for service desk issues' do before do - stub_feature_flags(service_desk_custom_email: false) issue.update!(external_author: 'service.desk@example.com') issue.issue_email_participants.create!(email: 'service.desk@example.com') end @@ -1558,42 +1557,30 @@ RSpec.describe Notify do end end - context 'when service_desk_custom_email is active' do - before do - stub_feature_flags(service_desk_custom_email: true) - end + context 'when custom email is enabled' do + let_it_be(:credentials) { create(:service_desk_custom_email_credential, project: project) } + let_it_be(:verification) { create(:service_desk_custom_email_verification, project: project) } - it_behaves_like 'a mail with default delivery method' - - it 'uses service bot name by default' do - expect_sender(Users::Internal.support_bot) + let_it_be(:settings) do + create( + :service_desk_setting, + project: project, + custom_email: 'supersupport@example.com' + ) end - context 'when custom email is enabled' do - let_it_be(:credentials) { create(:service_desk_custom_email_credential, project: project) } - let_it_be(:verification) { create(:service_desk_custom_email_verification, project: project) } - - let_it_be(:settings) do - create( - :service_desk_setting, - project: project, - custom_email: 'supersupport@example.com' - ) - end - - before_all do - verification.mark_as_finished! - project.reset - settings.update!(custom_email_enabled: true) - end + before_all do + verification.mark_as_finished! + project.reset + settings.update!(custom_email_enabled: true) + end - it 'uses custom email and service bot name in "from" header' do - expect_sender(Users::Internal.support_bot, sender_email: 'supersupport@example.com') - end + it 'uses custom email and service bot name in "from" header' do + expect_sender(Users::Internal.support_bot, sender_email: 'supersupport@example.com') + end - it 'uses SMTP delivery method and has correct settings' do - expect_service_desk_custom_email_delivery_options(settings) - end + it 'uses SMTP delivery method and has correct settings' do + expect_service_desk_custom_email_delivery_options(settings) end end end @@ -1623,42 +1610,30 @@ RSpec.describe Notify do end end - context 'when service_desk_custom_email is active' do - before do - stub_feature_flags(service_desk_custom_email: true) - end - - it_behaves_like 'a mail with default delivery method' + context 'when custom email is enabled' do + let_it_be(:credentials) { create(:service_desk_custom_email_credential, project: project) } + let_it_be(:verification) { create(:service_desk_custom_email_verification, project: project) } - it 'uses author\'s name in "from" header' do - expect_sender(first_note.author) + let_it_be(:settings) do + create( + :service_desk_setting, + project: project, + custom_email: 'supersupport@example.com' + ) end - context 'when custom email is enabled' do - let_it_be(:credentials) { create(:service_desk_custom_email_credential, project: project) } - let_it_be(:verification) { create(:service_desk_custom_email_verification, project: project) } - - let_it_be(:settings) do - create( - :service_desk_setting, - project: project, - custom_email: 'supersupport@example.com' - ) - end - - before_all do - verification.mark_as_finished! - project.reset - settings.update!(custom_email_enabled: true) - end + before_all do + verification.mark_as_finished! + project.reset + settings.update!(custom_email_enabled: true) + end - it 'uses custom email and author\'s name in "from" header' do - expect_sender(first_note.author, sender_email: project.service_desk_setting.custom_email) - end + it 'uses custom email and author\'s name in "from" header' do + expect_sender(first_note.author, sender_email: project.service_desk_setting.custom_email) + end - it 'uses SMTP delivery method and has correct settings' do - expect_service_desk_custom_email_delivery_options(settings) - end + it 'uses SMTP delivery method and has correct settings' do + expect_service_desk_custom_email_delivery_options(settings) end end end |