@@ -78,23 +78,40 @@ def test_errors_when_an_insert_query_is_called_while_preventing_writes_coerced
78
78
Subscriber . send ( :load_schema! )
79
79
original_test_errors_when_an_insert_query_is_called_while_preventing_writes
80
80
end
81
+
82
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
83
+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
84
+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes_coerced
85
+ Subscriber . send ( :load_schema! )
86
+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
87
+ end
88
+
89
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
90
+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
91
+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes_coerced
92
+ Subscriber . send ( :load_schema! )
93
+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
94
+ end
81
95
end
82
96
end
83
97
84
98
module ActiveRecord
85
99
class AdapterPreventWritesLegacyTest < ActiveRecord ::TestCase
86
- # We do some read queries. Remove assert_no_queries
100
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
87
101
coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes
88
102
def test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes_coerced
89
- @connection_handler . while_preventing_writes do
90
- @connection . transaction do
91
- assert_raises ( ActiveRecord ::ReadOnlyError ) do
92
- @connection . insert ( "/* some comment */ INSERT INTO subscribers(nick) VALUES ('138853948594')" , nil , false )
93
- end
94
- end
95
- end
103
+ Subscriber . send ( :load_schema! )
104
+ original_test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes
96
105
end
97
106
107
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
108
+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
109
+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes_coerced
110
+ Subscriber . send ( :load_schema! )
111
+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
112
+ end
113
+
114
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
98
115
coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
99
116
def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes_coerced
100
117
Subscriber . send ( :load_schema! )
0 commit comments