Skip to content

Commit 0692d53

Browse files
committed
coerce test to match sql server table quoting
1 parent 0f49d25 commit 0692d53

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,3 +2056,22 @@ def test_upsert_all_implicitly_sets_timestamps_on_create_when_model_record_times
20562056
end
20572057
end
20582058
end
2059+
2060+
class HasOneThroughDisableJoinsAssociationsTest < ActiveRecord::TestCase
2061+
# TODO: Remove coerce after Rails 7.1.0 (see https://github.com/rails/rails/pull/44051)
2062+
coerce_tests! :test_disable_joins_through_with_enum_type
2063+
def test_disable_joins_through_with_enum_type_coerced
2064+
joins = capture_sql { @member.club }
2065+
no_joins = capture_sql { @member.club_without_joins }
2066+
2067+
assert_equal 1, joins.size
2068+
assert_equal 2, no_joins.size
2069+
2070+
assert_match(/INNER JOIN/, joins.first)
2071+
no_joins.each do |nj|
2072+
assert_no_match(/INNER JOIN/, nj)
2073+
end
2074+
2075+
assert_match(/\[memberships\]\.\[type\]/, no_joins.first)
2076+
end
2077+
end

0 commit comments

Comments
 (0)