Files
sure/test/mailers/pdf_import_mailer_test.rb
sentry[bot] d09765a14c Add mailer subject tests and refine i18n keys (#910)
* Add mailer subject tests and refine i18n keys

* Linter

* Fix test

* More fixes

* More fixes

---------

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
2026-02-05 19:47:01 +01:00

26 lines
740 B
Ruby

require "test_helper"
class PdfImportMailerTest < ActionMailer::TestCase
setup do
@user = users(:family_admin)
@pdf_import = imports(:pdf_processed)
end
test "next_steps email is sent to user" do
mail = PdfImportMailer.with(user: @user, pdf_import: @pdf_import).next_steps
assert_equal I18n.t(
"pdf_import_mailer.next_steps.subject",
product_name: Rails.configuration.x.product_name
), mail.subject
assert_equal [ @user.email ], mail.to
assert_includes mail.subject, "analyzed"
end
test "next_steps email contains document summary" do
mail = PdfImportMailer.with(user: @user, pdf_import: @pdf_import).next_steps
assert_match @pdf_import.ai_summary, mail.body.encoded
end
end