From b479bd06b1cab7726a21648ea35a69d02a13fe56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Fri, 15 Dec 2023 08:47:16 +0100 Subject: [PATCH] test --- test/unit/custom_workflow_mailer_test.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/unit/custom_workflow_mailer_test.rb b/test/unit/custom_workflow_mailer_test.rb index 964d915..551a10b 100644 --- a/test/unit/custom_workflow_mailer_test.rb +++ b/test/unit/custom_workflow_mailer_test.rb @@ -42,16 +42,20 @@ def test_truth def test_custom_email CustomWorkflowMailer.deliver_custom_email @user2, subject: 'Subject', text_body: 'Body', html_body: 'Body' email = last_email - assert text_part(email).body.include?('Body'), "'Body' expected\n'#{response.body}' present'" - assert html_part(email).body.include?('Body'), "'Body' expected\n'#{response.body}' present'" + text = text_part(email).body + html = html_part(email).body + assert text.include?('Body'), "'Body' expected\n'#{text}' present'" + assert html.include?('Body'), "'Body' expected\n'#{html}' present'" end def test_custom_email_template CustomWorkflowMailer.deliver_custom_email @user2, subject: 'Subject', template_name: 'mailer/test_email', template_params: { url: Setting.host_name } email = last_email - assert text_part(email).body.include?('Body'), "'#{Setting.host_name} expected\n'#{response.body}' present'" - assert html_part(email).body.include?('Body'), "'#{Setting.host_name} expected\n'#{response.body}' present'" + text = text_part(email).body + html = html_part(email).body + assert text.include?('Body'), "'#{Setting.host_name} expected\n'#{text}' present'" + assert html.include?('Body'), "'#{Setting.host_name} expected\n'#{html}' present'" end private