add-tests.patch

Mizuki ISHIKAWA, 2019-05-24 08:02

Download (2.31 KB)

View differences:

test/unit/lib/redmine/wiki_formatting/html_parser_test.rb
34 34
    assert_equal "Text",
35 35
      @parser.to_text('<html><body><style>body {font-size: 0.8em;}</style>Text</body></html>')
36 36
  end
37

  
38
  def test_should_remove_space_of_beginning_of_line
39
    str = <<~EOS
40
      <table>
41
        <tr>
42
          <th>th1</th>
43
          <th>th2</th>
44
        </tr>
45
        <tr>
46
          <td>td1</td>
47
          <td>td2</td>
48
        </tr>
49
      </table>
50
    EOS
51

  
52
    assert_equal "th1\n\nth2\n\ntd1\n\ntd2",
53
      @parser.to_text(str)
54
  end
37 55
end
test/unit/lib/redmine/wiki_formatting/markdown_html_parser_test.rb
29 29
    assert_equal 'A **simple** html snippet.',
30 30
      @parser.to_text('<p>A <b>simple</b> html snippet.</p>')
31 31
  end
32

  
33
  def test_html_tables_conversion
34
    assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
35
      @parser.to_text('<table><tr><th>th1</th><th>th2</th></tr><tr><td>td1</td><td>td2</td></tr></table>')
36
  end
32 37
end
test/unit/lib/redmine/wiki_formatting/textile_html_parser_test.rb
29 29
    assert_equal 'A *simple* html snippet.',
30 30
      @parser.to_text('<p>A <b>simple</b> html snippet.</p>')
31 31
  end
32

  
33
  def test_html_tables_conversion
34
    assert_equal "*th1*\n*th2*\n\ntd1\ntd2",
35
      @parser.to_text('<table><tr><th>th1</th><th>th2</th></tr><tr><td>td1</td><td>td2</td></tr></table>')
36
  end
32 37
end