From 5c01a14a2d9dbccbf108a02bc76b4fa74fc053b6 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 3 Dec 2020 13:20:19 +0000 Subject: [PATCH] shorten long line of ApplicationHelperTest git-svn-id: http://svn.redmine.org/redmine/trunk@20559 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/helpers/application_helper_test.rb | 36 +++++++++++++++---------- 1 file 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 = 'jsmith@somenet.foo' # user link format: @jsmith@somenet.foo raw = "@jsmith@somenet.foo should not be parsed in jsmith@somenet.foo" assert_match( - %r{

#{u.name} should not be parsed in

}, - textilizable(raw, :project => Project.find(1))) - + %r{

#{u.name} should not be parsed in #{html}

}, + 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{

#{u.name} should not be parsed in

}, - textilizable(raw, :project => Project.find(1))) + %r{

#{u.name} should not be parsed in #{html}

}, + 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 = 'jsmith@somenet.foo' # user link format: @jsmith@somenet.foo raw = "@jsmith@somenet.foo should not be parsed in jsmith@somenet.foo" assert_match( - %r{

#{u.name} should not be parsed in jsmith@somenet.foo

}, - textilizable(raw, :project => Project.find(1))) - + %r{

#{u.name} should not be parsed in #{html}

}, + 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{

#{u.name} should not be parsed in jsmith@somenet.foo

}, - textilizable(raw, :project => Project.find(1))) + %r{

#{u.name} should not be parsed in #{html}

}, + 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 = 'http://example.com/url-r1/' assert_match( - %r{

r1 should not be parsed in http://example.com/url-r1/

}, - textilizable(raw, :project => Project.find(1))) + %r{

r1 should not be parsed in #{html}

}, + 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+_*' => 'bold, italic and underline', '(_text within parentheses_)' => '(text within parentheses)', 'a *Humane Web* Text Generator' => 'a Humane Web Text Generator', - 'a H *umane* W *eb* T *ext* G *enerator*' => 'a H umane W eb T ext G enerator', - 'a *H* umane *W* eb *T* ext *G* enerator' => 'a H umane W eb T ext G enerator', + 'a H *umane* W *eb* T *ext* G *enerator*' => + 'a H umane W eb T ext G enerator', + 'a *H* umane *W* eb *T* ext *G* enerator' => + 'a H umane W eb T ext G enerator', } to_test.each {|text, result| assert_equal "

#{result}

", textilizable(text)} end -- 2.39.5