diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-02-23 21:16:18 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-02-23 21:16:18 +0000 |
commit | ba74ba1c702e7a122328094341e659c2baf9fd3d (patch) | |
tree | b6d43d8beaf9538ff54bebd16768f29f7ef782a6 /test/unit/journal_test.rb | |
parent | 3a6c43deeec8f9f444008e43f53e58a6614716ed (diff) | |
download | redmine-ba74ba1c702e7a122328094341e659c2baf9fd3d.tar.gz redmine-ba74ba1c702e7a122328094341e659c2baf9fd3d.zip |
Allow users to be mentioned using @ in issues and wiki pages (#13919):
* the user must have add watchers permission on that object in order to mention other users
* mentioned user will receive a notification email
* only visible users who can view the object can be mentioned
git-svn-id: http://svn.redmine.org/redmine/trunk@21435 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/journal_test.rb')
-rw-r--r-- | test/unit/journal_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/journal_test.rb b/test/unit/journal_test.rb index 0e0177917..f9c269291 100644 --- a/test/unit/journal_test.rb +++ b/test/unit/journal_test.rb @@ -236,4 +236,12 @@ class JournalTest < ActiveSupport::TestCase assert_equal "image#{i}.png", attachment.filename end end + + def test_notified_mentions_should_not_include_users_who_cannot_view_private_notes + journal = Journal.generate!(journalized: Issue.find(2), user: User.find(1), private_notes: true, notes: 'Hello @dlopper, @jsmith and @admin.') + + # User "dlopper" has "Developer" role on project "eCookbook" + # Role "Developer" does not have the "View private notes" permission + assert_equal [1, 2], journal.notified_mentions.map(&:id) + end end |