summaryrefslogtreecommitdiff
path: root/spec/mailers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/in_product_marketing_spec.rb11
-rw-r--r--spec/mailers/notify_spec.rb6
2 files changed, 9 insertions, 8 deletions
diff --git a/spec/mailers/emails/in_product_marketing_spec.rb b/spec/mailers/emails/in_product_marketing_spec.rb
index 25735e64bdf..3d17e16ef48 100644
--- a/spec/mailers/emails/in_product_marketing_spec.rb
+++ b/spec/mailers/emails/in_product_marketing_spec.rb
@@ -5,7 +5,6 @@ require 'email_spec'
RSpec.describe Emails::InProductMarketing do
include EmailSpec::Matchers
- include InProductMarketingHelper
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
@@ -62,11 +61,13 @@ RSpec.describe Emails::InProductMarketing do
with_them do
it 'has the correct subject and content' do
+ message = Gitlab::Email::Message::InProductMarketing.for(track).new(group: group, series: series)
+
aggregate_failures do
- is_expected.to have_subject(subject_line(track, series))
- is_expected.to have_body_text(in_product_marketing_title(track, series))
- is_expected.to have_body_text(in_product_marketing_subtitle(track, series))
- is_expected.to have_body_text(in_product_marketing_cta_text(track, series))
+ is_expected.to have_subject(message.subject_line)
+ is_expected.to have_body_text(message.title)
+ is_expected.to have_body_text(message.subtitle)
+ is_expected.to have_body_text(CGI.unescapeHTML(message.cta_link))
end
end
end
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 94a081ae0c9..b073b647532 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -118,7 +118,7 @@ RSpec.describe Notify do
it 'contains a link to issue author' do
is_expected.to have_body_text(issue.author_name)
- is_expected.to have_body_text 'created an issue'
+ is_expected.to have_body_text 'created an issue:'
is_expected.to have_link(issue.to_reference, href: project_issue_url(issue.project, issue))
end
@@ -356,11 +356,11 @@ RSpec.describe Notify do
it 'contains a link to merge request author' do
is_expected.to have_body_text merge_request.author_name
- is_expected.to have_body_text 'created a'
+ is_expected.to have_body_text 'created a merge request:'
end
it 'contains a link to the merge request url' do
- is_expected.to have_link('merge request', href: project_merge_request_url(merge_request.target_project, merge_request))
+ is_expected.to have_link(merge_request.to_reference, href: project_merge_request_url(merge_request.target_project, merge_request))
end
end