@@ -52,23 +52,40 @@ def test_errors_when_an_insert_query_is_called_while_preventing_writes_coerced
52
52
Subscriber . send ( :load_schema! )
53
53
original_test_errors_when_an_insert_query_is_called_while_preventing_writes
54
54
end
55
+
56
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
57
+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
58
+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes_coerced
59
+ Subscriber . send ( :load_schema! )
60
+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
61
+ end
62
+
63
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
64
+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
65
+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes_coerced
66
+ Subscriber . send ( :load_schema! )
67
+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
68
+ end
55
69
end
56
70
end
57
71
58
72
module ActiveRecord
59
73
class AdapterPreventWritesLegacyTest < ActiveRecord ::TestCase
60
- # We do some read queries. Remove assert_no_queries
74
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
61
75
coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes
62
76
def test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes_coerced
63
- @connection_handler . while_preventing_writes do
64
- @connection . transaction do
65
- assert_raises ( ActiveRecord ::ReadOnlyError ) do
66
- @connection . insert ( "/* some comment */ INSERT INTO subscribers(nick) VALUES ('138853948594')" , nil , false )
67
- end
68
- end
69
- end
77
+ Subscriber . send ( :load_schema! )
78
+ original_test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes
70
79
end
71
80
81
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
82
+ coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
83
+ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes_coerced
84
+ Subscriber . send ( :load_schema! )
85
+ original_test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
86
+ end
87
+
88
+ # Fix randomly failing test. The loading of the model's schema was affecting the test.
72
89
coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes
73
90
def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_containing_read_command_is_called_while_preventing_writes_coerced
74
91
Subscriber . send ( :load_schema! )
0 commit comments