File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,12 @@ def test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_
6868 end
6969 end
7070 end
71+
72+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
73+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes_coerced
74+ Subscriber . send ( :load_schema! )
75+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
76+ end
7177 end
7278end
7379
@@ -1693,3 +1699,31 @@ def test_has_many_through_has_and_belongs_to_many_with_has_many_source_reflectio
16931699 )
16941700 end
16951701end
1702+
1703+ class BasePreventWritesTest < ActiveRecord ::TestCase
1704+ # SQL Server does not have query for release_savepoint
1705+ coerce_tests! %r{an empty transaction does not raise if preventing writes}
1706+ test "an empty transaction does not raise if preventing writes coerced" do
1707+ ActiveRecord ::Base . while_preventing_writes do
1708+ assert_queries ( 1 , ignore_none : true ) do
1709+ Bird . transaction do
1710+ ActiveRecord ::Base . connection . materialize_transactions
1711+ end
1712+ end
1713+ end
1714+ end
1715+ end
1716+
1717+ class BasePreventWritesLegacyTest < ActiveRecord ::TestCase
1718+ # SQL Server does not have query for release_savepoint
1719+ coerce_tests! %r{an empty transaction does not raise if preventing writes}
1720+ test "an empty transaction does not raise if preventing writes coerced" do
1721+ ActiveRecord ::Base . connection_handler . while_preventing_writes do
1722+ assert_queries ( 1 , ignore_none : true ) do
1723+ Bird . transaction do
1724+ ActiveRecord ::Base . connection . materialize_transactions
1725+ end
1726+ end
1727+ end
1728+ end
1729+ end
You can’t perform that action at this time.
0 commit comments