Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
commit5afcbe03ead9ada87621888a31a62652b10a7e4f (patch)
tree9918b67a0d0f0bafa6542e839a8be37adf73102d /spec/services/service_desk/custom_emails/create_service_spec.rb
parentc97c0201564848c1f53226fe19d71fdcc472f7d0 (diff)
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'spec/services/service_desk/custom_emails/create_service_spec.rb')
-rw-r--r--spec/services/service_desk/custom_emails/create_service_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/service_desk/custom_emails/create_service_spec.rb b/spec/services/service_desk/custom_emails/create_service_spec.rb
index 0d9582ba235..2029c9a0c3f 100644
--- a/spec/services/service_desk/custom_emails/create_service_spec.rb
+++ b/spec/services/service_desk/custom_emails/create_service_spec.rb
@@ -17,9 +17,14 @@ RSpec.describe ServiceDesk::CustomEmails::CreateService, feature_category: :serv
let(:params) { {} }
let(:message_delivery) { instance_double(ActionMailer::MessageDelivery) }
let(:message) { instance_double(Mail::Message) }
+ let(:logger_params) { { category: 'custom_email' } }
shared_examples 'a service that exits with error' do
it 'exits early' do
+ expect(Gitlab::AppLogger).to receive(:warn).with(logger_params.merge(
+ error_message: expected_error_message
+ )).once
+
response = service.execute
expect(response).to be_error
@@ -29,6 +34,10 @@ RSpec.describe ServiceDesk::CustomEmails::CreateService, feature_category: :serv
shared_examples 'a failing service that does not create records' do
it 'exits with error and does not create records' do
+ expect(Gitlab::AppLogger).to receive(:warn).with(logger_params.merge(
+ error_message: expected_error_message
+ )).once
+
response = service.execute
project.reset
@@ -148,6 +157,10 @@ RSpec.describe ServiceDesk::CustomEmails::CreateService, feature_category: :serv
end
it 'creates all records returns a successful response' do
+ # Because we also log in ServiceDesk::CustomEmailVerifications::CreateService
+ expect(Gitlab::AppLogger).to receive(:info).with({ category: 'custom_email_verification' }).once
+ expect(Gitlab::AppLogger).to receive(:info).with(logger_params).once
+
response = service.execute
project.reset