From 8bde0234bd18f163f5c1893ff48652fadb3fe5fd Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Thu, 12 Mar 2026 10:14:48 +0000 Subject: [PATCH] Add test for `UserMailer#follow_notification` --- test/mailers/user_mailer_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/mailers/user_mailer_test.rb b/test/mailers/user_mailer_test.rb index 4e0925ea8..cbe05ac14 100644 --- a/test/mailers/user_mailer_test.rb +++ b/test/mailers/user_mailer_test.rb @@ -109,6 +109,18 @@ class UserMailerTest < ActionMailer::TestCase assert_select body, "a[href='#{unsubscribe_url}']", :count => 1 end + def test_follow_notification + follow = create(:follow) + email = UserMailer.follow_notification(follow) + + follower_profile_url = url_helpers.user_url(follow.follower) + follow_follower_url = url_helpers.follow_url(follow.follower) + assert_match(ERB::Util.html_escape_once(follower_profile_url), email.html_part.body.to_s) + assert_match(ERB::Util.html_escape_once(follow_follower_url), email.html_part.body.to_s) + assert_match(follower_profile_url, email.text_part.body.to_s) + assert_match(follow_follower_url, email.text_part.body.to_s) + end + def test_changeset_comment_notification create(:language, :code => "en") user = create(:user) -- 2.39.5