summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-03-19 10:00:30 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-03-19 10:00:30 +0000
commit23874fa913c62f7da23f2d1fab6e5e1a445ae290 (patch)
treec446adf4e17ce15645637f746b0655e9334aa1ad /test
parentf286a6044be49b88b067f89072618aecc7164caa (diff)
downloadredmine-23874fa913c62f7da23f2d1fab6e5e1a445ae290.tar.gz
redmine-23874fa913c62f7da23f2d1fab6e5e1a445ae290.zip
Render mentioned users with leading @ and highlight (#36699, #13919).
git-svn-id: http://svn.redmine.org/redmine/trunk@21468 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/helpers/application_helper_test.rb14
-rw-r--r--test/unit/mailer_test.rb2
2 files changed, 8 insertions, 8 deletions
diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb
index f34daf55a..452892e8b 100644
--- a/test/helpers/application_helper_test.rb
+++ b/test/helpers/application_helper_test.rb
@@ -562,12 +562,12 @@ class ApplicationHelperTest < Redmine::HelperTest
'user:jsmith' => link_to_user(User.find_by_id(2)),
'user:JSMITH' => link_to_user(User.find_by_id(2)),
'user#2' => link_to_user(User.find_by_id(2)),
- '@jsmith' => link_to_user(User.find_by_id(2), class: 'user-mention'),
- '@jsmith.' => "#{link_to_user(User.find_by_id(2), class: 'user-mention')}.",
- '@JSMITH' => link_to_user(User.find_by_id(2), class: 'user-mention'),
- '@abcd@example.com' => link_to_user(User.find_by_id(u_email_id), class: 'user-mention'),
+ '@jsmith' => link_to_user(User.find_by_id(2), class: 'user-mention', mention: true),
+ '@jsmith.' => "#{link_to_user(User.find_by_id(2), class: 'user-mention', mention: true)}.",
+ '@JSMITH' => link_to_user(User.find_by_id(2), class: 'user-mention', mention: true),
+ '@abcd@example.com' => link_to_user(User.find_by_id(u_email_id), class: 'user-mention', mention: true),
'user:abcd@example.com' => link_to_user(User.find_by_id(u_email_id)),
- '@foo.bar@example.com' => link_to_user(User.find_by_id(u_email_id_2), class: 'user-mention'),
+ '@foo.bar@example.com' => link_to_user(User.find_by_id(u_email_id_2), class: 'user-mention', mention: true),
'user:foo.bar@example.com' => link_to_user(User.find_by_id(u_email_id_2)),
# invalid user
'user:foobar' => 'user:foobar',
@@ -596,7 +596,7 @@ class ApplicationHelperTest < Redmine::HelperTest
# 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 user-mention".*>#{u.name}</a> should not be parsed in #{html}</p>},
+ %r{<p><a class="user active user-mention".*>@#{u.name}</a> should not be parsed in #{html}</p>},
textilizable(raw, :project => Project.find(1))
)
# user link format: user:jsmith@somenet.foo
@@ -616,7 +616,7 @@ class ApplicationHelperTest < Redmine::HelperTest
# 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 user-mention\".*>#{u.name}</a> should not be parsed in #{html}</p>},
+ %r{<p><a class=\"user active user-mention\".*>@#{u.name}</a> should not be parsed in #{html}</p>},
textilizable(raw, :project => Project.find(1))
)
# user link format: user:jsmith@somenet.foo
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index 3e214b47d..b82d570bc 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -195,7 +195,7 @@ class MailerTest < ActiveSupport::TestCase
issue = Issue.generate!(:description => '@jsmith')
assert Mailer.deliver_issue_add(issue)
assert_select_email do
- assert_select "a[href=?]", "http://localhost:3000/users/2", :text => 'John Smith'
+ assert_select "a[href=?]", "http://localhost:3000/users/2", :text => '@John Smith'
end
end