Adjusts tests to new Mediacloth heading rendering
| 20 | 20 | ||
|---|---|---|---|
| 21 | def test_medialize | def test_medialize | 21 |
| 22 | str = "= Motiro =\n\nAnother paragraph" | str = "= Motiro =\n\nAnother paragraph" | 22 |
| 23 | assert_equal "<h1><a name='Motiro'></a> Motiro </h1><p><br />\n\n</p><p>Another paragraph</p>", | assert_equal "<h1><a name='Motiro'></a> Motiro </h1>\n<p>\nAnother paragraph</p>", | 23 |
| 24 | str.medialize | str.medialize | 24 |
| 25 | end | end | 25 |
| 26 | 26 |
| 28 | end | end | 28 |
|---|---|---|---|
| 29 | 29 | ||
| 30 | def test_renders_title | def test_renders_title | 30 |
| 31 | assert_equal "<h1><a name='Motiro'></a> Motiro </h1>", renderer.render_wiki_text('= Motiro =') | assert_equal "<h1><a name='Motiro'></a> Motiro </h1>\n", renderer.render_wiki_text('= Motiro =') | 31 |
| 32 | end | end | 32 |
| 33 | 33 | ||
| 34 | def test_breaks_paragraphs_on_linebreak_and_return_feed | def test_breaks_paragraphs_on_linebreak_and_return_feed | 34 |
| 35 | line_break_only_text = "= Motiro =\n\nThis is project Motiro" | line_break_only_text = "= Motiro =\n\nThis is project Motiro" | 35 |
| 36 | feed_return_text = "= Motiro =\r\n\r\nThis is project Motiro" | feed_return_text = "= Motiro =\r\n\r\nThis is project Motiro" | 36 |
| 37 | expected_text = "<h1><a name='Motiro'></a> Motiro </h1><p><br /></p><p>This is project Motiro</p>" | expected_text = "<h1><a name='Motiro'></a> Motiro </h1>\n<p>\nThis is project Motiro</p>" | 37 |
| 38 | 38 | ||
| 39 | assert_equal expected_text, renderer.render_wiki_text(line_break_only_text) | assert_equal expected_text, renderer.render_wiki_text(line_break_only_text) | 39 |
| 40 | assert_equal expected_text, renderer.render_wiki_text(feed_return_text) | assert_equal expected_text, renderer.render_wiki_text(feed_return_text) | 40 |
| 199 more lines | |||
| 240 | '<a name=\'Super_title\'><span style="background: #b8ffb8"></span></a> ' + | '<a name=\'Super_title\'><span style="background: #b8ffb8"></span></a> ' + | 240 |
| 241 | '<span style="background: #ffb8b8">Sub</span>' + | '<span style="background: #ffb8b8">Sub</span>' + | 241 |
| 242 | '<span style="background: #b8ffb8">Super</span> title</h2> ' + | '<span style="background: #b8ffb8">Super</span> title</h2> ' + | 242 |
| 243 | '<p><br /></p> ' + | "<p>\nParagraph</p>", | 243 |
| 244 | '<p>Paragraph</p>', | ||
| 245 | renderer.render_wiki_diff(previous, current) | renderer.render_wiki_diff(previous, current) | 244 |
| 246 | end | end | 245 |
| 247 | 246 | ||