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 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_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