From f902860955813645d70f669c3961ebd35d4ed9a1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 7 Jun 2017 20:10:57 +0000 Subject: 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 --- test/unit/helpers/application_helper_test.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') 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" => 'http://foo.bar/FAQ#3', + "http://foo.bar/FAQ#3" => 'http://foo.bar/FAQ#3', + # 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 "

#{result}

", 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{

#{u.name} should not be parsed in

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

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

}, -- cgit v1.2.3