From 27690fafa51976998fe879b7cfc5b55cff276984 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 17 Mar 2023 14:11:20 -0400 Subject: [PATCH 1/2] Add email support test case to mailer shared examples changelog: Internal, Automated Testing, Enhance mailer tests to check for email client support features --- spec/support/shared_examples_for_mailer.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/support/shared_examples_for_mailer.rb b/spec/support/shared_examples_for_mailer.rb index 5c71aca027d..aae6503adcc 100644 --- a/spec/support/shared_examples_for_mailer.rb +++ b/spec/support/shared_examples_for_mailer.rb @@ -3,6 +3,12 @@ expect(mail.from).to eq [IdentityConfig.store.email_from] expect(mail[:from].display_names).to eq [IdentityConfig.store.email_from_display_name] end + + it 'does not include markup or layout with lack of broad email support' do + body = mail.parts.first.body + + expect(body).not_to have_css('img[src$=".svg"]') + end end # expects there to be a let(:user) in scope From bab890477c2870868d9c2622c631aa4a7a93096d Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 17 Mar 2023 16:17:56 -0400 Subject: [PATCH 2/2] Link support reference For future recall --- spec/support/shared_examples_for_mailer.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/support/shared_examples_for_mailer.rb b/spec/support/shared_examples_for_mailer.rb index aae6503adcc..875c590c90e 100644 --- a/spec/support/shared_examples_for_mailer.rb +++ b/spec/support/shared_examples_for_mailer.rb @@ -7,6 +7,7 @@ it 'does not include markup or layout with lack of broad email support' do body = mail.parts.first.body + # https://www.caniemail.com/features/image-svg/ expect(body).not_to have_css('img[src$=".svg"]') end end