mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 13:55:52 +01:00
cleanup: rubocop: fix Layout/ClosingHeredocIndentation in test/unit/lib/redmine/wiki_formatting_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19170 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -39,11 +39,6 @@ Layout/AlignArguments:
|
|||||||
Layout/AlignHash:
|
Layout/AlignHash:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
Layout/ClosingHeredocIndentation:
|
|
||||||
Exclude:
|
|
||||||
- 'test/unit/lib/redmine/wiki_formatting_test.rb'
|
|
||||||
|
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
Layout/ClosingParenthesisIndentation:
|
Layout/ClosingParenthesisIndentation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|||||||
@@ -37,16 +37,14 @@ class Redmine::WikiFormattingTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_should_link_urls_and_email_addresses
|
def test_should_link_urls_and_email_addresses
|
||||||
raw = <<-DIFF
|
raw = <<~DIFF
|
||||||
This is a sample *text* with a link: http://www.redmine.org
|
This is a sample *text* with a link: http://www.redmine.org
|
||||||
and an email address foo@example.net
|
and an email address foo@example.net
|
||||||
DIFF
|
DIFF
|
||||||
|
expected = <<~EXPECTED
|
||||||
expected = <<-EXPECTED
|
<p>This is a sample *text* with a link: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a><br />
|
||||||
<p>This is a sample *text* with a link: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a><br />
|
and an email address <a class="email" href="mailto:foo@example.net">foo@example.net</a></p>
|
||||||
and an email address <a class="email" href="mailto:foo@example.net">foo@example.net</a></p>
|
EXPECTED
|
||||||
EXPECTED
|
|
||||||
|
|
||||||
assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
|
assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -57,16 +55,14 @@ EXPECTED
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_links_separated_with_line_break_should_link
|
def test_links_separated_with_line_break_should_link
|
||||||
raw = <<-DIFF
|
raw = <<~DIFF
|
||||||
link: https://www.redmine.org
|
link: https://www.redmine.org
|
||||||
http://www.redmine.org
|
http://www.redmine.org
|
||||||
DIFF
|
DIFF
|
||||||
|
expected = <<~EXPECTED
|
||||||
expected = <<-EXPECTED
|
<p>link: <a class="external" href="https://www.redmine.org">https://www.redmine.org</a><br />
|
||||||
<p>link: <a class="external" href="https://www.redmine.org">https://www.redmine.org</a><br />
|
<a class="external" href="http://www.redmine.org">http://www.redmine.org</a></p>
|
||||||
<a class="external" href="http://www.redmine.org">http://www.redmine.org</a></p>
|
EXPECTED
|
||||||
EXPECTED
|
|
||||||
|
|
||||||
assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
|
assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user