summaryrefslogtreecommitdiff
path: root/spec/support/helpers/email_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/email_helpers.rb')
-rw-r--r--spec/support/helpers/email_helpers.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/support/helpers/email_helpers.rb b/spec/support/helpers/email_helpers.rb
index ed049daba80..a7175491fa0 100644
--- a/spec/support/helpers/email_helpers.rb
+++ b/spec/support/helpers/email_helpers.rb
@@ -37,8 +37,19 @@ module EmailHelpers
ActionMailer::Base.deliveries.find { |d| d.to.include?(user.notification_email) }
end
- def have_referable_subject(referable, include_project: true, reply: false)
- prefix = (include_project && referable.project ? "#{referable.project.name} | " : '').freeze
+ def have_referable_subject(referable, include_project: true, include_group: false, reply: false)
+ context = []
+
+ context << referable.project.name if include_project && referable.project
+ context << referable.project.group.name if include_group && referable.project.group
+
+ prefix =
+ if context.any?
+ context.join(' | ') + ' | '
+ else
+ ''
+ end
+
prefix = "Re: #{prefix}" if reply
suffix = "#{referable.title} (#{referable.to_reference})"