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 31340ed commit b479bd0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/unit/custom_workflow_mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b479bd0

Please sign in to comment.