mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
* 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>
26 lines
740 B
Ruby
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
|