Fix tests - don't test standard rails features

This commit is contained in:
Dan Milne
2025-12-29 19:45:01 +11:00
parent 4c1df53fd5
commit 2a32d75895
5 changed files with 74 additions and 242 deletions

View File

@@ -107,17 +107,15 @@ class InvitationsMailerTest < ActionMailer::TestCase
end
test "should have proper email headers" do
email = @invitation_mail
# Deliver the email first to ensure headers are set
email = InvitationsMailer.invite_user(@user).deliver_now
# Test common email headers
# Test common email headers (message_id is set on delivery)
assert_not_nil email.message_id
assert_not_nil email.date
# Test content-type
if email.html_part
assert_includes email.content_type, "text/html"
elsif email.text_part
assert_includes email.content_type, "text/plain"
end
# Test content-type - multipart emails contain both text and html parts
assert_includes email.content_type, "multipart"
assert email.html_part || email.text_part, "Should have html or text part"
end
end