Skip to content

Commit 3735d70

Browse files
Fix one more test randomly failing due to array ordering issue on PG adapter
Reproduction command - ARCONN=postgresql be ruby -w -Itest test/cases/autosave_association_test.rb --seed 34101
1 parent 84b24c9 commit 3735d70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/test/cases/autosave_association_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,15 +1370,15 @@ def test_should_automatically_save_the_associated_models
13701370
@pirate.send(@association_name).each_with_index { |child, i| child.name = new_names[i] }
13711371

13721372
@pirate.save
1373-
assert_equal new_names, @pirate.reload.send(@association_name).map(&:name)
1373+
assert_equal new_names.sort, @pirate.reload.send(@association_name).map(&:name).sort
13741374
end
13751375

13761376
def test_should_automatically_save_bang_the_associated_models
13771377
new_names = ["Grace OMalley", "Privateers Greed"]
13781378
@pirate.send(@association_name).each_with_index { |child, i| child.name = new_names[i] }
13791379

13801380
@pirate.save!
1381-
assert_equal new_names, @pirate.reload.send(@association_name).map(&:name)
1381+
assert_equal new_names.sort, @pirate.reload.send(@association_name).map(&:name).sort
13821382
end
13831383

13841384
def test_should_update_children_when_autosave_is_true_and_parent_is_new_but_child_is_not

0 commit comments

Comments
 (0)