File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,25 @@ def test_update_date_time_attributes_with_default_timezone_local
243
243
end
244
244
end
245
245
246
+ class HasManyThroughAssociationsTest < ActiveRecord ::TestCase
247
+ # SQL Server does not have query for release_savepoint
248
+ coerce_tests! :test_associate_existing
249
+ def test_associate_existing_coerced
250
+ post = posts ( :thinking )
251
+ person = people ( :david )
252
+
253
+ assert_queries_count ( 2 ) do
254
+ post . people << person
255
+ end
256
+
257
+ assert_queries_count ( 1 ) do
258
+ assert_includes post . people , person
259
+ end
260
+
261
+ assert_includes post . reload . people . reload , person
262
+ end
263
+ end
264
+
246
265
class BelongsToAssociationsTest < ActiveRecord ::TestCase
247
266
# Since @client.firm is a single first/top, and we use FETCH the order clause is used.
248
267
coerce_tests! :test_belongs_to_does_not_use_order_by
You can’t perform that action at this time.
0 commit comments