Created
July 8, 2022 16:15
-
-
Save palkan/7f3a8cb3c904449e089b03448d14185d to your computer and use it in GitHub Desktop.
mailers_preview_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "rails_helper" | |
# Automatically smoke-test all mailer previews | |
describe "/rails/mailers" do | |
subject { response } | |
ActionMailer::Preview.all.each do |preview| | |
next if preview.emails.empty? | |
describe "/#{preview.preview_name}" do | |
preview.emails.each do |email| | |
specify "/#{email}" do | |
get "/rails/mailers/#{preview.preview_name}/#{email}" | |
is_expected.to be_successful | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment