diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-03 13:20:19 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-03 13:20:19 +0000 |
commit | 5c01a14a2d9dbccbf108a02bc76b4fa74fc053b6 (patch) | |
tree | 7c5e1259373fb94a0ad7411c914b9a2f66426faa | |
parent | 66262850f16631dd07c4ba2b460bd2461a980695 (diff) | |
download | redmine-5c01a14a2d9dbccbf108a02bc76b4fa74fc053b6.tar.gz redmine-5c01a14a2d9dbccbf108a02bc76b4fa74fc053b6.zip |
shorten long line of ApplicationHelperTest
git-svn-id: http://svn.redmine.org/redmine/trunk@20559 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/helpers/application_helper_test.rb | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 42af59566..8a7fe3e37 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -508,44 +508,50 @@ class ApplicationHelperTest < Redmine::HelperTest def test_user_links_with_email_as_login_name_should_not_be_parsed_textile with_settings :text_formatting => 'textile' do u = User.generate!(:login => 'jsmith@somenet.foo') + html = '<a class="email" href="mailto:jsmith@somenet.foo">jsmith@somenet.foo</a>' # user link format: @jsmith@somenet.foo raw = "@jsmith@somenet.foo should not be parsed in jsmith@somenet.foo" assert_match( - %r{<p><a class="user active".*>#{u.name}</a> should not be parsed in <a class="email" href="mailto:jsmith@somenet.foo">jsmith@somenet.foo</a></p>}, - textilizable(raw, :project => Project.find(1))) - + %r{<p><a class="user active".*>#{u.name}</a> should not be parsed in #{html}</p>}, + textilizable(raw, :project => Project.find(1)) + ) # user link format: user:jsmith@somenet.foo raw = "user:jsmith@somenet.foo should not be parsed in jsmith@somenet.foo" assert_match( - %r{<p><a class="user active".*>#{u.name}</a> should not be parsed in <a class="email" href="mailto:jsmith@somenet.foo">jsmith@somenet.foo</a></p>}, - textilizable(raw, :project => Project.find(1))) + %r{<p><a class="user active".*>#{u.name}</a> should not be parsed in #{html}</p>}, + textilizable(raw, :project => Project.find(1)) + ) end end def test_user_links_with_email_as_login_name_should_not_be_parsed_markdown with_settings :text_formatting => 'markdown' do u = User.generate!(:login => 'jsmith@somenet.foo') + html = '<a href=\"mailto:jsmith@somenet.foo\">jsmith@somenet.foo</a>' # user link format: @jsmith@somenet.foo raw = "@jsmith@somenet.foo should not be parsed in jsmith@somenet.foo" assert_match( - %r{<p><a class=\"user active\".*>#{u.name}</a> should not be parsed in <a href=\"mailto:jsmith@somenet.foo\">jsmith@somenet.foo</a></p>}, - textilizable(raw, :project => Project.find(1))) - + %r{<p><a class=\"user active\".*>#{u.name}</a> should not be parsed in #{html}</p>}, + textilizable(raw, :project => Project.find(1)) + ) # user link format: user:jsmith@somenet.foo raw = "user:jsmith@somenet.foo should not be parsed in jsmith@somenet.foo" assert_match( - %r{<p><a class=\"user active\".*>#{u.name}</a> should not be parsed in <a href=\"mailto:jsmith@somenet.foo\">jsmith@somenet.foo</a></p>}, - textilizable(raw, :project => Project.find(1))) + %r{<p><a class=\"user active\".*>#{u.name}</a> should not be parsed in #{html}</p>}, + textilizable(raw, :project => Project.find(1)) + ) end end def test_should_not_parse_redmine_links_inside_link raw = "r1 should not be parsed in http://example.com/url-r1/" + html = '<a class="external" href="http://example.com/url-r1/">http://example.com/url-r1/</a>' assert_match( - %r{<p><a class="changeset".*>r1</a> should not be parsed in <a class="external" href="http://example.com/url-r1/">http://example.com/url-r1/</a></p>}, - textilizable(raw, :project => Project.find(1))) + %r{<p><a class="changeset".*>r1</a> should not be parsed in #{html}</p>}, + textilizable(raw, :project => Project.find(1)) + ) end def test_redmine_links_with_a_different_project_before_current_project @@ -1330,8 +1336,10 @@ class ApplicationHelperTest < Redmine::HelperTest '*_+bold, italic and underline+_*' => '<strong><em><ins>bold, italic and underline</ins></em></strong>', '(_text within parentheses_)' => '(<em>text within parentheses</em>)', 'a *Humane Web* Text Generator' => 'a <strong>Humane Web</strong> Text Generator', - 'a H *umane* W *eb* T *ext* G *enerator*' => 'a H <strong>umane</strong> W <strong>eb</strong> T <strong>ext</strong> G <strong>enerator</strong>', - 'a *H* umane *W* eb *T* ext *G* enerator' => 'a <strong>H</strong> umane <strong>W</strong> eb <strong>T</strong> ext <strong>G</strong> enerator', + 'a H *umane* W *eb* T *ext* G *enerator*' => + 'a H <strong>umane</strong> W <strong>eb</strong> T <strong>ext</strong> G <strong>enerator</strong>', + 'a *H* umane *W* eb *T* ext *G* enerator' => + 'a <strong>H</strong> umane <strong>W</strong> eb <strong>T</strong> ext <strong>G</strong> enerator', } to_test.each {|text, result| assert_equal "<p>#{result}</p>", textilizable(text)} end |