diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-01 00:07:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-01 00:07:14 +0300 |
commit | 24fb09b2eb3f4703b09eef3c9bbf842cd055626a (patch) | |
tree | 3c1f69360a0ce9b15c97fb25efa4424d4ef5f334 /spec/mailers | |
parent | 1d21e1712158ee4e3cf8b71b45ead662529fc3f8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/emails/service_desk_spec.rb | 22 |
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 |