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-10-30 16:00:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-30 16:00:33 +0300
commite11efedcfcd80b2d55a1bdd17b317cef82ce0a0e (patch)
treedd176669205ad33e6b7e7e19068695af130e7a41 /spec/mailers
parent5ba663860c0d90a17657b0cbb53ac582bf7edd43 (diff)
Add latest changes from gitlab-org/security/gitlab@16-5-stable-ee
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/service_desk_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/mailers/emails/service_desk_spec.rb b/spec/mailers/emails/service_desk_spec.rb
index e3fe36237df..b700819ed2c 100644
--- a/spec/mailers/emails/service_desk_spec.rb
+++ b/spec/mailers/emails/service_desk_spec.rb
@@ -263,6 +263,28 @@ RSpec.describe Emails::ServiceDesk, feature_category: :service_desk do
let(:expected_template_html) { "<p dir=\"auto\">thank you, your new issue has been created. </p>#{issue.description_html}" }
it_behaves_like 'a service desk notification email with template content', 'thank_you'
+
+ context 'when GitLab-specific-reference is in description' do
+ let(:full_issue_reference) { "#{issue.project.full_path}#{issue.to_reference}" }
+ let(:other_issue) { create(:issue, project: project, description: full_issue_reference) }
+
+ let(:template_content) { '%{ISSUE_DESCRIPTION}' }
+ let(:expected_template_html) { "<p data-sourcepos=\"1:1-1:22\" dir=\"auto\">#{full_issue_reference}</p>" }
+
+ subject { ServiceEmailClass.service_desk_thank_you_email(other_issue.id) }
+
+ before do
+ expect(Gitlab::Template::ServiceDeskTemplate).to receive(:find)
+ .with('thank_you', other_issue.project)
+ .and_return(template)
+
+ other_issue.issue_email_participants.create!(email: email)
+ end
+
+ it 'does not render GitLab-specific-reference links with title attribute' do
+ is_expected.to have_body_text(expected_template_html)
+ end
+ end
end
context 'when issue url placeholder is used' do