Skip to content

Commit 9b71375

Browse files
authored
Coerce test an empty transaction does not raise if preventing writes. (#788)
The transaction in the test become SavepointTransaction because tests automatically wrapped in transaction, and SQL Server does not have query for release_savepoint
1 parent a07552c commit 9b71375

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ def test_update_date_time_attributes_with_default_timezone_local
177177
end
178178
end
179179
end
180+
181+
# SQL Server does not have query for release_savepoint
182+
coerce_tests! %r{an empty transaction does not raise if preventing writes}
183+
test "an empty transaction does not raise if preventing writes coerced" do
184+
ActiveRecord::Base.connection_handler.while_preventing_writes do
185+
assert_queries(1, ignore_none: true) do
186+
Bird.transaction do
187+
ActiveRecord::Base.connection.materialize_transactions
188+
end
189+
end
190+
end
191+
end
180192
end
181193

182194

0 commit comments

Comments
 (0)