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-03-28 03:11:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-28 03:11:35 +0300
commit9968d394403ad6601fe8fdf24072fdb1ec08e1a3 (patch)
tree166816d8e27a067d55203641da6d4bc8a693c549 /spec/mailers
parentff2a881e2038a523c71f0d3f044c496bb7617fd5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/notify_spec.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 7f838e0caf9..83c132e0969 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -151,9 +151,27 @@ RSpec.describe Notify do
it 'has the correct subject and body' do
aggregate_failures do
is_expected.to have_referable_subject(issue, reply: true)
- is_expected.to have_body_text(previous_assignee.name)
- is_expected.to have_body_text(assignee.name)
- is_expected.to have_body_text(project_issue_path(project, issue))
+ is_expected.to have_body_text("Assignee changed from <strong>#{previous_assignee.name}</strong> to <strong>#{assignee.name}</strong>")
+ is_expected.to have_body_text(%(<a href="#{project_issue_url(project, issue)}">view it on GitLab</a>))
+ is_expected.to have_body_text("You're receiving this email because of your account")
+ end
+ end
+
+ context 'without new assignee' do
+ before do
+ issue.update!(assignees: [])
+ end
+
+ it 'uses "Unassigned" placeholder' do
+ is_expected.to have_body_text("Assignee changed from <strong>#{previous_assignee.name}</strong> to <strong>Unassigned</strong>")
+ end
+ end
+
+ context 'without previous assignees' do
+ subject { described_class.reassigned_issue_email(recipient.id, issue.id, [], current_user.id) }
+
+ it 'uses short text' do
+ is_expected.to have_body_text("Assignee changed to <strong>#{assignee.name}</strong>")
end
end