diff --git a/test/fixtures/webs.yml b/test/fixtures/webs.yml index 05437295..c847d96f 100644 --- a/test/fixtures/webs.yml +++ b/test/fixtures/webs.yml @@ -4,7 +4,7 @@ test_wiki: updated_at: 2005-08-01 name: wiki1 address: wiki1 - markup: textile + markup: markdownMML instiki: id: 2 @@ -12,4 +12,4 @@ instiki: updated_at: 2005-08-01 name: Instiki address: instiki - markup: textile \ No newline at end of file + markup: markdownMML diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 8e8590c3..44cfb458 100755 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -151,7 +151,7 @@ class WikiControllerTest < Test::Unit::TestCase assert_response(:success, bypass_body_parsing = true) assert_equal 'application/zip', r.headers['Content-Type'] - assert_match /attachment; filename="wiki1-textile-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.zip"/, + assert_match /attachment; filename="wiki1-markdownMML-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.zip"/, r.headers['Content-Disposition'] assert_equal 'PK', r.body[0..1], 'Content is not a zip file' end @@ -665,14 +665,45 @@ class WikiControllerTest < Test::Unit::TestCase r = process('tex', 'web' => 'wiki1', 'id' => 'HomePage') assert_response(:success) - assert_equal "\\documentclass[12pt,titlepage]{article}\n\n\\usepackage{amsmath}" + - "\n\\usepackage{amsfonts}\n\\usepackage{graphicx}\n\\usepackage{ucs}\n" + - "\\usepackage[utf8x]{inputenc}\n\\usepackage{hyperref}\n\n" + - "%-------------------------------------------------------------------\n\n" + - "\\begin{document}\n\n%--------------------------------------------------" + - "-----------------\n\n\\section*{HomePage}\n\nTeX export only supported with" + - " the Markdown text filters.\n\n\\end{document}\n", - r.body + assert_equal %q!\documentclass[12pt,titlepage]{article} + +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{ucs} +\usepackage[utf8x]{inputenc} +\usepackage{hyperref} + +%----Macros---------- +\newcommand{\gt}{>} +\newcommand{\lt}{<} +\newcommand{\darr}{\downarrow} +\newcommand{\nearr}{\nearrow} +\newcommand{\nwarr}{\nwarrow} +\newcommand{\searr}{\searrow} +\newcommand{\swarr}{\swarrow} +\newcommand{\iff}{\Longleftrightarrow} +\newcommand{\impliedby}{\Leftarrow} +\newcommand{\map}{\mapsto} +\newcommand{\embedsin}{\hookrightarrow} +\newcommand{\implies}{\Rightarrow} +\newcommand{\qed}{\blacksquare} + +%------------------------------------------------------------------- + +\begin{document} + +%------------------------------------------------------------------- + +\section*{HomePage} + +HisWay would be MyWay in kinda ThatWay in HisWay though MyWay $\backslash$OverThere --{} see SmartEngine in that SmartEngineGUI + + + +\end{document} +!, r.body end diff --git a/test/unit/page_renderer_test.rb b/test/unit/page_renderer_test.rb index 94544d72..7be3c7d1 100644 --- a/test/unit/page_renderer_test.rb +++ b/test/unit/page_renderer_test.rb @@ -46,7 +46,7 @@ class PageRendererTest < Test::Unit::TestCase 'would be My Way in kinda ' + 'That Way in ' + 'His Way? ' + - %{though My Way OverThere—see } + + %{though My Way OverThere \xE2\x80\x93 see } + 'Smart Engine in that ' + 'Smart Engine GUI' + '?
', @@ -157,21 +157,21 @@ class PageRendererTest < Test::Unit::TestCase assert_markup_parsed_as( 'should we go ' + 'That Way or This Way?' + - '
', + '', '_should we go ThatWay or ThisWay _') end # wikiwords are invalid as styles, must be in "name: value" form def test_content_with_wikiword_in_style_tag assert_markup_parsed_as( - "That is some Stylish Emphasis
", + "That is some Stylish Emphasis
", 'That is some Stylish Emphasis') end # validates format of style.. def test_content_with_valid_style_in_style_tag assert_markup_parsed_as( - "That is some Stylish Emphasis
", + "That is some Stylish Emphasis
", 'That is some Stylish Emphasis') end @@ -182,38 +182,38 @@ class PageRendererTest < Test::Unit::TestCase def test_content_with_pre_blocks assert_markup_parsed_as( - 'A class SmartEngine end
would not mark up
CodeBlocks', - 'A
class SmartEngine end
would not mark up CodeBlocks') + '
A class SmartEngine end
would not mark up
CodeBlocks\n\n
would it?
', + 'Aclass SmartEngine end
would not mark up\n\nCodeBlocks\n\nwould it?') end def test_content_with_autolink_in_parentheses assert_markup_parsed_as( - '
The W3C body (' +
+ ' The W3C body (' +
'http://www.w3c.org) sets web standards This is a Textile image link. This is a Markdown image link. This is an inline image link. This is an inline image link. This <IMG SRC="http://hobix.com/sample.jpg" alt=""> is an inline image link. This <IMG SRC="http://hobix.com/sample.jpg" alt=""></IMG> is an inline image link.
Version History' + - "?
\n\n\n\tcry " + + "?
\n\ncry " + 'Version History?' + '
', test_renderer(@revision).display_content @revision.content = "f\r\nVersionHistory\r\n\r\ncry VersionHistory" - assert_equal "f
Version History" +
- "?
cry " + + assert_equal "
f Version History" + + "?
\n\ncry " + "Version History?" + "
", test_renderer(@revision).display_content @@ -321,12 +321,12 @@ class PageRendererTest < Test::Unit::TestCase def test_list_with_tildas list_with_tildas = <<-EOL - * "a":~b - * c~ d +* [a](~b) +* c~ d EOL assert_markup_parsed_as( - "