Address intermittent CI failure due to non-determined sort order

https://buildkite.com/rails/rails/builds/76112#1aa6023d-f58e-4c3e-96cc-027e36f2f415/973-984
This commit is contained in:
Ryuta Kamizono 2021-03-30 02:18:53 +09:00
parent bad93fe2a1
commit 6ce14ee4bc
1 changed files with 1 additions and 1 deletions

View File

@ -301,7 +301,7 @@ class DatabaseConnectedJsonEncodingTest < ActiveRecord::TestCase
def test_should_be_able_to_encode_relation
set_include_root_in_json(true) do
authors_relation = Author.where(id: [@david.id, @mary.id])
authors_relation = Author.where(id: [@david.id, @mary.id]).order(:id)
json = ActiveSupport::JSON.encode authors_relation, only: :name
assert_equal '[{"author":{"name":"David"}},{"author":{"name":"Mary"}}]', json