From 586004ade5d3601e19e48d928c5d0271ac4f36d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Fri, 15 Dec 2023 07:43:55 +0100 Subject: [PATCH] test --- test/unit/custom_workflow_mailer_test.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/unit/custom_workflow_mailer_test.rb b/test/unit/custom_workflow_mailer_test.rb index 73623a4..eeb9513 100644 --- a/test/unit/custom_workflow_mailer_test.rb +++ b/test/unit/custom_workflow_mailer_test.rb @@ -39,11 +39,19 @@ def test_truth assert_kind_of User, @user2 end - def test_custom_email - CustomWorkflowMailer.deliver_custom_email @user2, subject: 'Subject', text_body: 'Body', html_body: 'Body' + # 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'), text_part(email).body + # assert html_part(email).body.include?('Body'), html_part(email).body + # end + + def test_custom_email_template + CustomWorkflowMailer.deliver_custom_email @user2, subject: 'Subject', template_name: 'mailer/my_email', + template_params: { url: Rails.root } email = last_email - assert text_part(email).body.include?('Body'), text_part(email).body - assert html_part(email).body.include?('Body'), html_part(email).body + assert text_part(email).body.include?('Body'), Rails.root.to_s + assert html_part(email).body.include?('Body'), Rails.root.to_s end private