File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,17 @@ def test_value_limit_violations_are_translated_to_specific_exception_coerced
4747module ActiveRecord
4848 class AdapterPreventWritesTest < ActiveRecord ::TestCase
4949 # Fix randomly failing test. The loading of the model's schema was affecting the test.
50+ # Also, we do some read queries. Remove assert_no_queries
5051 coerce_tests! :test_errors_when_an_insert_query_is_called_while_preventing_writes
5152 def test_errors_when_an_insert_query_is_called_while_preventing_writes_coerced
5253 Subscriber . send ( :load_schema! )
53- original_test_errors_when_an_insert_query_is_called_while_preventing_writes
54+ assert_raises ( ActiveRecord ::ReadOnlyError ) do
55+ ActiveRecord ::Base . while_preventing_writes do
56+ @connection . transaction do
57+ @connection . insert ( "INSERT INTO subscribers(nick) VALUES ('138853948594')" , nil , false )
58+ end
59+ end
60+ end
5461 end
5562 end
5663end
You can’t perform that action at this time.
0 commit comments