From a85b776324bbe7c335fc3211e2c4d7782778be1b Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 24 Nov 2019 13:19:39 +0000 Subject: [PATCH] cleanup: rubocop: fix Layout/IndentFirstHashElement in test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19260 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../wiki_formatting/textile_formatter_test.rb | 146 +++++++++++------- 1 file changed, 88 insertions(+), 58 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 04920d848..61c5cdfb7 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -66,50 +66,62 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase def test_styles # single style - assert_html_output({ - 'p{color:red}. text' => '

text

', - 'p{color:red;}. text' => '

text

', - 'p{color: red}. text' => '

text

', - 'p{color:#f00}. text' => '

text

', - 'p{color:#ff0000}. text' => '

text

', - 'p{border:10px}. text' => '

text

', - 'p{border:10}. text' => '

text

', - 'p{border:10%}. text' => '

text

', - 'p{border:10em}. text' => '

text

', - 'p{border:1.5em}. text' => '

text

', - 'p{border-left:1px}. text' => '

text

', - 'p{border-right:1px}. text' => '

text

', - 'p{border-top:1px}. text' => '

text

', - 'p{border-bottom:1px}. text' => '

text

', - 'p{width:50px}. text' => '

text

', - 'p{max-width:100px}. text' => '

text

', - 'p{height:40px}. text' => '

text

', - 'p{max-height:80px}. text' => '

text

', - }, false) + assert_html_output( + { + 'p{color:red}. text' => '

text

', + 'p{color:red;}. text' => '

text

', + 'p{color: red}. text' => '

text

', + 'p{color:#f00}. text' => '

text

', + 'p{color:#ff0000}. text' => '

text

', + 'p{border:10px}. text' => '

text

', + 'p{border:10}. text' => '

text

', + 'p{border:10%}. text' => '

text

', + 'p{border:10em}. text' => '

text

', + 'p{border:1.5em}. text' => '

text

', + 'p{border-left:1px}. text' => '

text

', + 'p{border-right:1px}. text' => '

text

', + 'p{border-top:1px}. text' => '

text

', + 'p{border-bottom:1px}. text' => '

text

', + 'p{width:50px}. text' => '

text

', + 'p{max-width:100px}. text' => '

text

', + 'p{height:40px}. text' => '

text

', + 'p{max-height:80px}. text' => '

text

', + }, + false + ) # multiple styles - assert_html_output({ - 'p{color:red; border-top:1px}. text' => '

text

', - 'p{color:red ; border-top:1px}. text' => '

text

', - 'p{color:red;border-top:1px}. text' => '

text

', - }, false) + assert_html_output( + { + 'p{color:red; border-top:1px}. text' => '

text

', + 'p{color:red ; border-top:1px}. text' => '

text

', + 'p{color:red;border-top:1px}. text' => '

text

', + }, + false + ) # styles with multiple values - assert_html_output({ - 'p{border:1px solid red;}. text' => '

text

', - 'p{border-top-left-radius: 10px 5px;}. text' => '

text

', - }, false) + assert_html_output( + { + 'p{border:1px solid red;}. text' => '

text

', + 'p{border-top-left-radius: 10px 5px;}. text' => '

text

', + }, + false + ) end def test_invalid_styles_should_be_filtered - assert_html_output({ - 'p{invalid}. text' => '

text

', - 'p{invalid:red}. text' => '

text

', - 'p{color:(red)}. text' => '

text

', - 'p{color:red;invalid:blue}. text' => '

text

', - 'p{invalid:blue;color:red}. text' => '

text

', - 'p{color:"}. text' => '

p{color:"}. text

', - }, false) + assert_html_output( + { + 'p{invalid}. text' => '

text

', + 'p{invalid:red}. text' => '

text

', + 'p{color:(red)}. text' => '

text

', + 'p{color:red;invalid:blue}. text' => '

text

', + 'p{invalid:blue;color:red}. text' => '

text

', + 'p{color:"}. text' => '

p{color:"}. text

', + }, + false + ) end def test_inline_code @@ -168,15 +180,21 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase end def test_kbd - assert_html_output({ - 'test' => 'test' - }, false) + assert_html_output( + { + 'test' => 'test' + }, + false + ) end def test_use_of_backslashes_followed_by_numbers_in_headers - assert_html_output({ - 'h1. 2009\02\09' => '

2009\02\09

' - }, false) + assert_html_output( + { + 'h1. 2009\02\09' => '

2009\02\09

' + }, + false + ) end def test_double_dashes_should_not_strikethrough @@ -565,27 +583,39 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase end def test_should_prefix_class_attribute_on_tags - assert_html_output({ - '!(foo)test.png!' => "

\"\"

", - '%(foo)test%' => "

test

", - 'p(foo). test' => "

test

", - '|(foo). test|' => "\n\t\t\n\t\t\t\n\t\t\n\t
test
", - }, false) + assert_html_output( + { + '!(foo)test.png!' => "

\"\"

", + '%(foo)test%' => "

test

", + 'p(foo). test' => "

test

", + '|(foo). test|' => + "\n\t\t\n\t\t\t\n\t\t\n\t
test
", + }, + false + ) end def test_should_prefix_id_attribute_on_tags - assert_html_output({ - '!(#foo)test.png!' => "

\"\"

", - '%(#foo)test%' => "

test

", - 'p(#foo). test' => "

test

", - '|(#foo). test|' => "\n\t\t\n\t\t\t\n\t\t\n\t
test
", - }, false) + assert_html_output( + { + '!(#foo)test.png!' => "

\"\"

", + '%(#foo)test%' => "

test

", + 'p(#foo). test' => "

test

", + '|(#foo). test|' => + "\n\t\t\n\t\t\t\n\t\t\n\t
test
", + }, + false + ) end def test_should_not_prefix_class_and_id_attributes_already_prefixed - assert_html_output({ - '!(wiki-class-foo#wiki-id-bar)test.png!' => "

\"\"

", - }, false) + assert_html_output( + { + '!(wiki-class-foo#wiki-id-bar)test.png!' => + "

\"\"

", + }, + false + ) end def test_footnotes -- 2.39.5