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
165 165

  
166 166
  def test_escaping
167 167
    assert_html_output(
168
      'this is a <script>'      => 'this is a &lt;script&gt;'
168
      'this is a <script>'      => 'this is a &lt;script&gt;',
169
      'this is a <TEST>'    => 'this is a &lt;TEST&gt;',
169 170
    )
170 171
  end
171 172

  
test/unit/mailer_test.rb
317 317
    end
318 318
  end
319 319

  
320
  def test_issue_add_enclosed_in_lt_and_gt
321
    issue = Issue.find(2)
322
    issue.update(:description => 'aaa<bbb>ccc AAA<BBB>CCC')
323
    assert Mailer.deliver_issue_add(issue)
324

  
325
    # text part
326
    assert_mail_body_match 'aaa<bbb>ccc AAA<BBB>CCC', last_email
327
    # html part
328
    assert_select_email do
329
      assert_select 'p', :text => 'aaa<bbb>ccc AAA<BBB>CCC'
330
    end
331
  end
332

  
333
  def test_issue_edit_enclosed_in_lt_and_gt
334
    journal = Journal.find(3)
335
    journal.update(:notes => 'ddd<eee>fff DDD<EEE>FFF')
336
    assert Mailer.deliver_issue_edit(journal)
337

  
338
    # text part
339
    assert_mail_body_match 'ddd<eee>fff DDD<EEE>FFF', last_email
340
    # html part
341
    assert_select_email do
342
      assert_select 'p', :text => 'ddd<eee>fff DDD<EEE>FFF'
343
    end
344
  end
345

  
320 346
  def test_message_posted_message_id
321 347
    message = Message.find(1)
322 348
    Mailer.deliver_message_posted(message)
(5-5/5)