diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-03 21:11:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-03 21:11:11 +0300 |
commit | 5b0916450cebb6a88bd651fd0579737541c355c8 (patch) | |
tree | 3a788fd8e2ef18b1c6e06d222e84bb5d84307870 /spec/mailers | |
parent | 78aaabb87f180e93fa53aba407a0eef1e12a7a56 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/notify_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index a5e3350ec2e..098ac21eb18 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -613,6 +613,28 @@ RSpec.describe Notify do it 'has References header including the notes and issue of the discussion' do expect(subject.header['References'].message_ids).to include("issue_#{note.noteable.id}@#{host}") end + + context 'with private references accessible to the recipient' do + let_it_be(:private_project) { create(:project, :private) } + let_it_be(:private_issue) { create(:issue, :closed, project: private_project) } + + before_all do + private_project.add_guest(recipient) + + note.update!(note: "#{private_issue.to_reference(full: true)}") + end + + let(:html_part) { subject.body.parts.last.to_s } + + it 'does not redact the reference' do + expect(html_part).to include("data-reference-type=\"issue\"") + expect(html_part).to include("title=\"#{private_issue.title}\"") + end + + it 'renders expanded issue references' do + expect(html_part).to include("#{private_issue.to_reference(full: true)} (closed)") + end + end end end |