diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-07 20:10:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-07 20:10:57 +0000 |
commit | f902860955813645d70f669c3961ebd35d4ed9a1 (patch) | |
tree | 3a8cde2aed5aadcb4263d765bccea816f4ab2918 /test | |
parent | c513037c6edce0d039b2f6ab602be8a309e2b68c (diff) | |
download | redmine-f902860955813645d70f669c3961ebd35d4ed9a1.tar.gz redmine-f902860955813645d70f669c3961ebd35d4ed9a1.zip |
Link to user in wiki syntax (#4179).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@16636 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 500fbd86e..678dcfda5 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -383,12 +383,25 @@ RAW # invalid expressions 'source:' => 'source:', # url hash - "http://foo.bar/FAQ#3" => '<a class="external" href="http://foo.bar/FAQ#3">http://foo.bar/FAQ#3</a>', + "http://foo.bar/FAQ#3" => '<a class="external" href="http://foo.bar/FAQ#3">http://foo.bar/FAQ#3</a>', + # user + 'user:jsmith' => link_to_user(User.find_by_id(2)), + '@jsmith' => link_to_user(User.find_by_id(2)), + # invalid user + 'user:foobar' => 'user:foobar', } @project = Project.find(1) to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" } end + def test_user_links_with_email_as_login_name_should_not_be_parsed + u = User.generate!(:login => '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)) + end + def test_should_not_parse_redmine_links_inside_link raw = "r1 should not be parsed in http://example.com/url-r1/" 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>}, |