From 43b245acdc3db14eabbe907c67796712d2769adb Mon Sep 17 00:00:00 2001
From: Toshi MARUYAMA #{result} #{result} #{result}
',
- 'floating !>http://foo.bar/image.jpg!' => 'floating
',
- 'with class !(some-class)http://foo.bar/image.jpg!' => 'with class
',
- 'with class !(wiki-class-foo)http://foo.bar/image.jpg!' => 'with class
',
- 'with style !{width:100px;height:100px}http://foo.bar/image.jpg!' => 'with style
',
- 'with title !http://foo.bar/image.jpg(This is a title)!' => 'with title
',
- 'with title !http://foo.bar/image.jpg(This is a double-quoted "title")!' => 'with title
',
+ 'floating !>http://foo.bar/image.jpg!' =>
+ 'floating
',
+ 'with class !(some-class)http://foo.bar/image.jpg!' =>
+ 'with class
',
+ 'with class !(wiki-class-foo)http://foo.bar/image.jpg!' =>
+ 'with class
',
+ 'with style !{width:100px;height:100px}http://foo.bar/image.jpg!' =>
+ 'with style
',
+ 'with title !http://foo.bar/image.jpg(This is a title)!' =>
+ 'with title
',
+ 'with title !http://foo.bar/image.jpg(This is a double-quoted "title")!' =>
+ 'with title
',
}
to_test.each {|text, result| assert_equal "
',
- 'Inline image: !logo.GIF!' => 'Inline image:
',
+ 'Inline image: !logo.gif!' =>
+ 'Inline image:
',
+ 'Inline image: !logo.GIF!' =>
+ 'Inline image:
',
'No match: !ogo.gif!' => 'No match:
',
'No match: !ogo.GIF!' => 'No match: ',
# link image
- '!logo.gif!:http://foo.bar/' => '
',
+ '!logo.gif!:http://foo.bar/' =>
+ '
',
}
attachments = Attachment.all
to_test.each {|text, result| assert_equal "), textilizable("!#{filename}!", :attachments => [attachment])
+ assert_include %(
),
+ textilizable("!#{filename}!", :attachments => [attachment])
end
end
end
@@ -183,7 +204,8 @@ class ApplicationHelperTest < Redmine::HelperTest
with_settings :text_formatting => 'markdown' do
to_test.each do |filename, result|
attachment = Attachment.generate!(:filename => filename)
- assert_include %(
), textilizable("", :attachments => [attachment])
+ assert_include %(
),
+ textilizable("", :attachments => [attachment])
end
end
end
@@ -191,7 +213,8 @@ class ApplicationHelperTest < Redmine::HelperTest
def test_attached_images_with_hires_naming
attachment = Attachment.generate!(:filename => 'image@2x.png')
assert_equal(
- %(


Another paragraph",
# no multiline link text
- "This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line
and another on a second line\":test",
+ "This is a double quote \"on the first line\nand another on a second line\":test" =>
+ "This is a double quote \"on the first line
and another on a second line\":test",
# mailto link
- "\"system administrator\":mailto:sysadmin@example.com?subject=redmine%20permissions" => "system administrator",
+ "\"system administrator\":mailto:sysadmin@example.com?subject=redmine%20permissions" =>
+ "system administrator",
# two exclamation marks
- '"a link":http://example.net/path!602815048C7B5C20!302.html' => 'a link',
+ '"a link":http://example.net/path!602815048C7B5C20!302.html' =>
+ 'a link',
# escaping
'"test":http://foo"bar' => 'test',
# ends with a hyphen
- '(see "inline link":http://www.foo.bar/Test-)' => '(see inline link)',
- 'http://foo.bar/page?p=1&t=z&s=-' => 'http://foo.bar/page?p=1&t=z&s=-',
+ '(see "inline link":http://www.foo.bar/Test-)' =>
+ '(see inline link)',
+ 'http://foo.bar/page?p=1&t=z&s=-' =>
+ 'http://foo.bar/page?p=1&t=z&s=-',
'This is an intern "link":/foo/bar-' => 'This is an intern link'
}
to_test.each {|text, result| assert_equal "
#{result}
", textilizable(text)} @@ -1747,7 +1776,8 @@ class ApplicationHelperTest < Redmine::HelperTest [projects(:projects_001), 'eCookbook'], [users(:users_001), 'Redmine Admin'], [versions(:versions_001), 'eCookbook - 0.1'], - [wiki_pages(:wiki_pages_001), 'CookBook documentation'] + [wiki_pages(:wiki_pages_001), + 'CookBook documentation'] ].each do |record, link| assert_equal link, link_to_record(record) end @@ -1773,7 +1803,8 @@ class ApplicationHelperTest < Redmine::HelperTest [news_attachment, 'eCookbook first release !'], [attachments(:attachments_008), 'Files'], [attachments(:attachments_009), 'Files'], - [attachments(:attachments_003), 'Page with an inline image'], + [attachments(:attachments_003), + 'Page with an inline image'], ].each do |attachment, link| assert_equal link, link_to_attachment_container(attachment.container) end @@ -1838,7 +1869,8 @@ class ApplicationHelperTest < Redmine::HelperTest set_language_if_valid 'en' users = [User.find(2), User.find(4)] User.current = User.find(4) - assert_include '', principals_options_for_select(users) + assert_include '', + principals_options_for_select(users) end def test_stylesheet_link_tag_should_pick_the_default_stylesheet @@ -1846,7 +1878,8 @@ class ApplicationHelperTest < Redmine::HelperTest end def test_stylesheet_link_tag_for_plugin_should_pick_the_plugin_stylesheet - assert_match 'href="/plugin_assets/foo/stylesheets/styles.css"', stylesheet_link_tag("styles", :plugin => :foo) + assert_match 'href="/plugin_assets/foo/stylesheets/styles.css"', + stylesheet_link_tag("styles", :plugin => :foo) end def test_image_tag_should_pick_the_default_image @@ -1976,8 +2009,10 @@ class ApplicationHelperTest < Redmine::HelperTest end def test_html_hours - assert_equal '0:45', html_hours('0:45') - assert_equal '0.75', html_hours('0.75') + assert_equal '0:45', + html_hours('0:45') + assert_equal '0.75', + html_hours('0.75') end def test_form_for_includes_name_attribute @@ -2009,7 +2044,9 @@ class ApplicationHelperTest < Redmine::HelperTest with_locale 'en' do assert_not_equal l(:general_csv_encoding), 'UTF-8' result = export_csv_encoding_select_tag - assert_select_in result, "option[selected='selected'][value=#{l(:general_csv_encoding)}]", :text => l(:general_csv_encoding) + assert_select_in result, + "option[selected='selected'][value=#{l(:general_csv_encoding)}]", + :text => l(:general_csv_encoding) assert_select_in result, "option[value='UTF-8']", :text => 'UTF-8' end end