Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion spec/mailers/previews/user_mailer_preview_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
RSpec.describe UserMailerPreview do
UserMailerPreview.instance_methods(false).each do |mailer_method|
describe "##{mailer_method}" do
subject(:mail) { UserMailerPreview.new.public_send(mailer_method) }

it 'generates a preview without blowing up' do
expect { UserMailerPreview.new.public_send(mailer_method).body }.to_not raise_error
expect { mail.body }.to_not raise_error
end

it 'does not include any svg images' do
# SVGs are typically the preferred format for their high-quality and small file size, but
# they are not well-supported in email clients. Instead, store a rasterized version of the
# image in `app/assets/images/email` for use in mailer content.
expect(mail.html_part.body).not_to have_selector("img[src$='.svg']")
end
end
end
Expand Down