Project

General

Profile

Patch #28207 » 0002-Move-textile-footnotes-test-to-TextileFormatterTest.patch

Mischa The Evil, 2018-02-17 23:56

View differences:

test/helpers/application_helper_test.rb
1048 1048
    assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---')
1049 1049
  end
1050 1050

  
1051
  def test_footnotes
1052
    raw = <<-RAW
1053
This is some text[1].
1054

  
1055
fn1. This is the foot note
1056
RAW
1057

  
1058
    expected = <<-EXPECTED
1059
<p>This is some text<sup><a href=\"#fn1\">1</a></sup>.</p>
1060
<p id="fn1" class="footnote"><sup>1</sup> This is the foot note</p>
1061
EXPECTED
1062

  
1063
    assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '')
1064
  end
1065

  
1066 1051
  def test_headings
1067 1052
    raw = 'h1. Some heading'
1068 1053
    expected = %|<a name="Some-heading"></a>\n<h1 >Some heading<a href="#Some-heading" class="wiki-anchor">&para;</a></h1>|
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
581 581
    }, false)
582 582
  end
583 583

  
584
  def test_footnotes
585
    text = <<-STR
586
This is some text[1].
587

  
588
fn1. This is the foot note
589
STR
590

  
591
    expected = <<-EXPECTED
592
<p>This is some text<sup><a href=\"#fn1\">1</a></sup>.</p>
593
<p id="fn1" class="footnote"><sup>1</sup> This is the foot note</p>
594
EXPECTED
595

  
596
    assert_equal expected.gsub(%r{[\r\n\t]}, ''), to_html(text).gsub(%r{[\r\n\t]}, '')
597
  end
598

  
584 599
  private
585 600

  
586 601
  def assert_html_output(to_test, expect_paragraph = true)
(2-2/2)