Project

General

Profile

Defect #31021 » 0003-Add-tests.patch

Yuichi HARADA, 2019-03-28 05:18

View differences:

test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
def test_escaping
assert_html_output(
'this is a <script>' => 'this is a &lt;script&gt;'
'this is a <script>' => 'this is a &lt;script&gt;',
'this is a <TEST>' => 'this is a &lt;TEST&gt;',
)
end
test/unit/mailer_test.rb
end
end
def test_issue_add_enclosed_in_lt_and_gt
issue = Issue.find(2)
issue.update(:description => 'aaa<bbb>ccc AAA<BBB>CCC')
assert Mailer.deliver_issue_add(issue)
# text part
assert_mail_body_match 'aaa<bbb>ccc AAA<BBB>CCC', last_email
# html part
assert_select_email do
assert_select 'p', :text => 'aaa<bbb>ccc AAA<BBB>CCC'
end
end
def test_issue_edit_enclosed_in_lt_and_gt
journal = Journal.find(3)
journal.update(:notes => 'ddd<eee>fff DDD<EEE>FFF')
assert Mailer.deliver_issue_edit(journal)
# text part
assert_mail_body_match 'ddd<eee>fff DDD<EEE>FFF', last_email
# html part
assert_select_email do
assert_select 'p', :text => 'ddd<eee>fff DDD<EEE>FFF'
end
end
def test_message_posted_message_id
message = Message.find(1)
Mailer.deliver_message_posted(message)
(5-5/5)