File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1350,6 +1350,15 @@ def test_does_not_duplicate_optimizer_hints_on_merge_coerced
13501350 query = Post . optimizer_hints ( "OMGHINT" ) . merge ( Post . optimizer_hints ( "OMGHINT" ) ) . to_sql
13511351 assert_equal expected , query
13521352 end
1353+
1354+ # Workaround for randomly failing test. Ordering of results not guaranteed.
1355+ # TODO: Remove coerced test when https://github.com/rails/rails/pull/44168 merged.
1356+ coerce_tests! :test_select_quotes_when_using_from_clause
1357+ def test_select_quotes_when_using_from_clause_coerced
1358+ quoted_join = ActiveRecord ::Base . connection . quote_table_name ( "join" )
1359+ selected = Post . select ( :join ) . from ( Post . select ( "id as #{ quoted_join } " ) ) . map ( &:join )
1360+ assert_equal Post . pluck ( :id ) . sort , selected . sort
1361+ end
13531362 end
13541363end
13551364
You can’t perform that action at this time.
0 commit comments