@@ -64,16 +64,17 @@ class UserMailerTest < ActionMailer::TestCase
6464 email = Pay ::UserMailer . with ( pay_customer : @pay_customer , pay_subscription : Pay ::Subscription . new , date : time ) . subscription_renewing
6565
6666 assert_equal [ @user . email ] , email . to
67- assert_equal I18n . t ( "pay.user_mailer.subscription_renewing.subject" , application : Pay . application_name ) , email . subject
68- assert_includes email . body . decoded , I18n . l ( time . to_date , format : :long )
67+ assert_equal I18n . t ( "pay.user_mailer.subscription_renewing.subject" , application : Pay . application_name ) ,
68+ email . subject
69+ assert_includes email . html_part . decoded , I18n . l ( time . to_date , format : :long )
6970 end
7071
7172 test "payment_action_required" do
7273 email = Pay ::UserMailer . with ( pay_customer : @pay_customer , payment_intent_id : "x" , pay_subscription : Pay ::Subscription . new ) . payment_action_required
7374
7475 assert_equal [ @user . email ] , email . to
7576 assert_equal I18n . t ( "pay.user_mailer.payment_action_required.subject" , application : Pay . application_name ) , email . subject
76- assert_includes email . body . decoded , Pay ::Engine . instance . routes . url_helpers . payment_path ( "x" )
77+ assert_includes email . html_part . decoded , Pay ::Engine . instance . routes . url_helpers . payment_path ( "x" )
7778 end
7879
7980 test "receipt with no extra billing info column" do
@@ -99,22 +100,22 @@ class UserMailerTest < ActionMailer::TestCase
99100
100101 assert_equal [ @user . email ] , email . to
101102 assert_equal I18n . t ( "pay.user_mailer.subscription_trial_will_end.subject" , application : Pay . application_name ) , email . subject
102- assert_includes email . body . decoded , "trial is ending soon"
103+ assert_includes email . html_part . decoded , "trial is ending soon"
103104 end
104105
105106 test "subscription_trial_ended" do
106107 email = Pay ::UserMailer . with ( pay_customer : @pay_customer ) . subscription_trial_ended
107108
108109 assert_equal [ @user . email ] , email . to
109110 assert_equal I18n . t ( "pay.user_mailer.subscription_trial_ended.subject" , application : Pay . application_name ) , email . subject
110- assert_includes email . body . decoded , "trial has ended"
111+ assert_includes email . html_part . decoded , "trial has ended"
111112 end
112113
113114 test "subscription payment failed" do
114115 email = Pay ::UserMailer . with ( pay_customer : @pay_customer ) . payment_failed
115116
116117 assert_equal [ @user . email ] , email . to
117118 assert_equal I18n . t ( "pay.user_mailer.payment_failed.subject" , application : Pay . application_name ) , email . subject
118- assert_includes email . body . decoded , "payment was declined"
119+ assert_includes email . html_part . decoded , "payment was declined"
119120 end
120121end
0 commit comments