summaryrefslogtreecommitdiffstats
path: root/test/unit/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-11 17:51:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-11 17:51:14 +0000
commit965ef33192990c53d846e7bc77502dcf66ecd793 (patch)
tree5269a225ac39b27768fa0ac781bd10b7b1379fee /test/unit/lib
parent462d0ddfe8b3be694ad0f85ee6e3df39525ff574 (diff)
downloadredmine-965ef33192990c53d846e7bc77502dcf66ecd793.tar.gz
redmine-965ef33192990c53d846e7bc77502dcf66ecd793.zip
Fixed that lines with spaces only before headings break wiki section extraction (#11133).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9822 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
index 3f33e5eb7..26f9993d0 100644
--- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
@@ -394,6 +394,31 @@ Nulla nunc nisi, egestas in ornare vel, posuere ac libero."]
@formatter.new(text).update_section(3, replacement)
end
+ def test_get_section_should_support_lines_with_spaces_before_heading
+ # the lines after Content 2 and Heading 4 contain a space
+ text = <<-STR
+h1. Heading 1
+
+Content 1
+
+h1. Heading 2
+
+Content 2
+
+h1. Heading 3
+
+Content 3
+
+h1. Heading 4
+
+Content 4
+STR
+
+ [1, 2, 3, 4].each do |index|
+ assert_match /\Ah1. Heading #{index}.+Content #{index}/m, @formatter.new(text).get_section(index).first
+ end
+ end
+
private
def assert_html_output(to_test, expect_paragraph = true)