From 218218b78361fc3fd4ea572ce51533d34e8ab64d Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Tue, 20 Aug 2024 06:06:27 +0000 Subject: Fix flacky test after Rails 7 update which fails occasionally because database records are not ordered, so it is necessary to specify the sort order when testing (#36320). Patch by Takashi Kato (user:tohosaku). git-svn-id: https://svn.redmine.org/redmine/trunk@22964 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/api_test/issues_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb index 84abe70ed..02840b2ef 100644 --- a/test/integration/api_test/issues_test.rb +++ b/test/integration/api_test/issues_test.rb @@ -242,7 +242,7 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base assert_select 'issue journals[type=array]' do assert_select 'journal[id="1"]' do - assert_select 'updated_on', :text => Issue.find(1).journals[0].updated_on.iso8601 + assert_select 'updated_on', :text => Issue.find(1).journals.order(:id)[0].updated_on.iso8601 assert_select 'updated_by[id="1"][name="Redmine Admin"]' assert_select 'private_notes', :text => 'false' assert_select 'details[type=array]' do -- cgit v1.2.3