Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
picman committed Dec 15, 2023
1 parent de3692e commit 586004a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/unit/custom_workflow_mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 586004a

Please sign in to comment.