@@ -64,18 +64,21 @@ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containin
64
64
65
65
module ActiveRecord
66
66
class AdapterPreventWritesLegacyTest < ActiveRecord ::TestCase
67
- # We do some read queries. Remove assert_no_queries
67
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
68
68
coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes
69
69
def test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes_coerced
70
- @connection_handler . while_preventing_writes do
71
- @connection . transaction do
72
- assert_raises ( ActiveRecord ::ReadOnlyError ) do
73
- @connection . insert ( "/* some comment */ INSERT INTO subscribers(nick) VALUES ('138853948594')" , nil , false )
74
- end
75
- end
76
- end
70
+ Subscriber . send ( :load_schema! )
71
+ original_test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes
77
72
end
78
73
74
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
75
+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
76
+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes_coerced
77
+ Subscriber . send ( :load_schema! )
78
+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
79
+ end
80
+
81
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
79
82
coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
80
83
def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes_coerced
81
84
Subscriber . send ( :load_schema! )
0 commit comments