96.99% test coverage

This commit is contained in:
2026-01-31 15:46:40 +01:00
parent 8ec8f15857
commit 4bc393887b
20 changed files with 2899 additions and 62 deletions
@@ -0,0 +1,23 @@
require "test_helper"
class PasswordResetMailerTest < ActionMailer::TestCase
test "reset email contains token and expiry" do
user = users(:admin_user)
user.update!(
reset_password_token: "reset_token_123",
reset_password_sent_at: Time.current
)
email = PasswordResetMailer.reset(user)
assert_emails 1 do
email.deliver_now
end
assert_equal [ user.email ], email.to
assert_equal "Reset your Sanasto Wiki password", email.subject
assert_includes email.content_type, "text/html"
assert_includes email.body.encoded, "reset_token_123"
assert_includes email.body.encoded, "Password Reset Request"
assert_includes email.body.encoded, "will expire on"
end
end