##// END OF EJS Templates
Merged r12899 (#16077)....
Jean-Philippe Lang -
r12644:01aa2db0af8b
parent child
Show More
@@ -221,7 +221,7 module Redmine
221 out = ''.html_safe
221 out = ''.html_safe
222 out << link_to_function(show_label, js, :id => "#{html_id}-show", :class => 'collapsible collapsed')
222 out << link_to_function(show_label, js, :id => "#{html_id}-show", :class => 'collapsible collapsed')
223 out << link_to_function(hide_label, js, :id => "#{html_id}-hide", :class => 'collapsible', :style => 'display:none;')
223 out << link_to_function(hide_label, js, :id => "#{html_id}-hide", :class => 'collapsible', :style => 'display:none;')
224 out << content_tag('div', textilizable(text, :object => obj), :id => html_id, :class => 'collapsed-text', :style => 'display:none;')
224 out << content_tag('div', textilizable(text, :object => obj, :headings => false), :id => html_id, :class => 'collapsed-text', :style => 'display:none;')
225 out
225 out
226 end
226 end
227
227
@@ -235,6 +235,22 class Redmine::WikiFormatting::MacrosTest < ActionView::TestCase
235 assert_select_in result, 'a.collapsible', :text => 'Hide example'
235 assert_select_in result, 'a.collapsible', :text => 'Hide example'
236 end
236 end
237
237
238 def test_macro_collapse_should_not_break_toc
239 text = <<-RAW
240 {{toc}}
241
242 h1. Title
243
244 {{collapse(Show example, Hide example)
245 h2. Heading
246 }}"
247 RAW
248
249 expected_toc = '<ul class="toc"><li><a href="#Title">Title</a><ul><li><a href="#Heading">Heading</a></li></ul></li></ul>'
250
251 assert_include expected_toc, textilizable(text).gsub(/[\r\n]/, '')
252 end
253
238 def test_macro_child_pages
254 def test_macro_child_pages
239 expected = "<p><ul class=\"pages-hierarchy\">\n" +
255 expected = "<p><ul class=\"pages-hierarchy\">\n" +
240 "<li><a href=\"/projects/ecookbook/wiki/Child_1\">Child 1</a>\n" +
256 "<li><a href=\"/projects/ecookbook/wiki/Child_1\">Child 1</a>\n" +
General Comments 0
You need to be logged in to leave comments. Login now