summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-11-29 01:15:14 +0000
committerGo MAEDA <maeda@farend.jp>2024-11-29 01:15:14 +0000
commit8d218ba6b9a7951de3783e85846b655a9b267c49 (patch)
tree5e01328bea790bda445d988c60eccd5ab4595100
parent2a2c12f5b00e90d1a5fb42d2bee489cbf892272c (diff)
downloadredmine-8d218ba6b9a7951de3783e85846b655a9b267c49.tar.gz
redmine-8d218ba6b9a7951de3783e85846b655a9b267c49.zip
Fix random test failures in Redmine::Acts::MentionableTest due to unsorted mentioned_users (#41889).
Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23322 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/lib/redmine/acts/mentionable_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/unit/lib/redmine/acts/mentionable_test.rb b/test/unit/lib/redmine/acts/mentionable_test.rb
index 86f6b7cf2..8471c51af 100644
--- a/test/unit/lib/redmine/acts/mentionable_test.rb
+++ b/test/unit/lib/redmine/acts/mentionable_test.rb
@@ -49,13 +49,13 @@ class Redmine::Acts::MentionableTest < ActiveSupport::TestCase
def test_mentioned_users_with_multiple_mentions
issue = Issue.generate!(project_id: 1, description: 'Hello @dlopper, @jsmith.')
- assert_equal [User.find(2), User.find(3)], issue.mentioned_users
+ assert_equal [User.find(2), User.find(3)], issue.mentioned_users.sort_by(&:id)
end
def test_mentioned_users_should_not_mention_same_user_multiple_times
issue = Issue.generate!(project_id: 1, description: '@dlopper @jsmith @dlopper')
- assert_equal [User.find(2), User.find(3)], issue.mentioned_users
+ assert_equal [User.find(2), User.find(3)], issue.mentioned_users.sort_by(&:id)
end
def test_mentioned_users_should_include_only_active_users
@@ -137,7 +137,7 @@ class Redmine::Acts::MentionableTest < ActiveSupport::TestCase
def test_notified_mentions
issue = Issue.generate!(project_id: 1, description: 'Hello @dlopper, @jsmith.')
- assert_equal [User.find(2), User.find(3)], issue.notified_mentions
+ assert_equal [User.find(2), User.find(3)], issue.notified_mentions.sort_by(&:id)
end
def test_notified_mentions_should_not_include_users_who_out_of_all_email