Skip to content

Commit 0823821

Browse files
committed
Override test_finding_with_subquery_with_eager_loading_in_from
The test relies on deterministic order of SELECT results, but did not include an ORDER BY
1 parent ee9f667 commit 0823821

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

test/cases/relations_test.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
require "cases/helper"
4+
require "models/post"
5+
require "models/comment"
6+
7+
class RelationTest < ActiveRecord::TestCase
8+
fixtures :posts, :comments
9+
10+
def test_finding_with_subquery_with_eager_loading_in_from
11+
relation = Comment.includes(:post).where("posts.type": "Post").order(:id)
12+
assert_equal relation.to_a, Comment.select("*").from(relation).order(:id).to_a
13+
assert_equal relation.to_a, Comment.select("subquery.*").from(relation).order(:id).to_a
14+
assert_equal relation.to_a, Comment.select("a.*").from(relation, :a).order(:id).to_a
15+
end
16+
end

test/excludes/RelationTest.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
exclude :test_finding_with_sanitized_order, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48"
2+
exclude :test_finding_with_subquery_with_eager_loading_in_from, "Overridden because test depends on ordering of results."

0 commit comments

Comments
 (0)