Skip to content

Commit fe842e8

Browse files
committed
Coerce test as no query to release savepoint
1 parent e7c4f6d commit fe842e8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/cases/coerced_tests.rb

+19
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,25 @@ def test_update_date_time_attributes_with_default_timezone_local
243243
end
244244
end
245245

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+
246265
class BelongsToAssociationsTest < ActiveRecord::TestCase
247266
# Since @client.firm is a single first/top, and we use FETCH the order clause is used.
248267
coerce_tests! :test_belongs_to_does_not_use_order_by

0 commit comments

Comments
 (0)