<%= @wiki_page.pretty_title %>
-a b c
", p("a [[b]] c")) - assert_equal("a spoiler c
", p("a [[spoiler]] c")) + assert_equal("a b c
", p("a [[b]] c")) + assert_equal("a spoiler c
", p("a [[spoiler]] c")) end def test_spoilers @@ -46,16 +46,22 @@ class DTextTest < ActiveSupport::TestCase assert_equal('a (http://test.com) b
', p('a (http://test.com) b')) end - def test_links - assert_equal('', p('[url=http://test.com]test[/url]')) - assert_equal('"1" 2
', p('"1" [url=http://two.com]2[/url]')) - assert_equal('"1" 2 & 3
', p('"1" [url=http://three.com]2 & 3[/url]')) + # def test_links + # assert_equal('', p('[url=http://test.com]test[/url]')) + # assert_equal('"1" 2
', p('"1" [url=http://two.com]2[/url]')) + # assert_equal('"1" 2 & 3
', p('"1" [url=http://three.com]2 & 3[/url]')) + # end + + def test_old_syle_links + assert_equal('', p('"test":http://test.com')) + assert_equal('"1" 2
', p('"1" "2":http://two.com')) + assert_equal('"1" 2 & 3
', p('"1" "2 & 3":http://three.com')) end - def test_aliased_urls - assert_equal('a bob. b
', p('a [url=http://test.com]bob[/url]. b')) - assert_equal('', p('[i][url=http://test.com]bob[/url][/i]')) - end + # def test_aliased_urls + # assert_equal('a bob. b
', p('a [url=http://test.com]bob[/url]. b')) + # assert_equal('', p('[i][url=http://test.com]bob[/url][/i]')) + # end def test_lists assert_equal('- a
a
b
', p("a\n\n\n\n\n\n\nb\n\n\n\n")) end + + def test_complex_links + assert_equal('', p("[[1|2 3]] | [[4|5 6]]")) + assert_equal("Tags (howto:tag | howto:tag checklist | Tag Groups)
", p("Tags [b]([[howto:tag|Tagging Guidelines]] | [[howto:tag_checklist|Tag Checklist]] | [[Tag Groups]])[/b]")) + end end