Project

General

Profile

Actions

Defect #39180

closed

Fix an intermittent test failure in JournalTest

Added by Vincent Robert about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

This test occasionally fails when executed concurrently with CI tools.

diff --git a/test/unit/journal_test.rb b/test/unit/journal_test.rb
class JournalTest < ActiveSupport::TestCase
  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)
+   assert_equal [1, 2], journal.notified_mentions.map(&:id).sort
   end
 end
Actions

Also available in: Atom PDF