File tree 1 file changed +10
-12
lines changed
1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -2197,25 +2197,23 @@ def test_insert_all_coerced
2197
2197
Task . cache { Task . insert ( { starting : Time . now } ) }
2198
2198
end
2199
2199
2200
- assert_called ( ActiveRecord ::Base . lease_connection , :clear_query_cache , times : 2 ) do
2201
- Task . cache { Task . insert_all! ( [ { starting : Time . now } ] ) }
2202
- end
2203
-
2204
- assert_called ( ActiveRecord ::Base . lease_connection , :clear_query_cache , times : 2 ) do
2205
- Task . cache { Task . insert! ( { starting : Time . now } ) }
2206
- end
2207
-
2208
- assert_called ( ActiveRecord ::Base . lease_connection , :clear_query_cache , times : 2 ) do
2209
- Task . cache { Task . insert_all! ( [ { starting : Time . now } ] ) }
2210
- end
2211
-
2212
2200
assert_raises ( ArgumentError , /does not support upsert/ ) do
2213
2201
Task . cache { Task . upsert ( { starting : Time . now } ) }
2214
2202
end
2215
2203
2216
2204
assert_raises ( ArgumentError , /does not support upsert/ ) do
2217
2205
Task . cache { Task . upsert_all ( [ { starting : Time . now } ] ) }
2218
2206
end
2207
+
2208
+ Task . cache do
2209
+ assert_called ( ActiveRecord ::Base . connection_pool . query_cache , :clear , times : 1 ) do
2210
+ Task . insert_all! ( [ starting : Time . now ] )
2211
+ end
2212
+
2213
+ assert_called ( ActiveRecord ::Base . connection_pool . query_cache , :clear , times : 1 ) do
2214
+ Task . insert! ( { starting : Time . now } )
2215
+ end
2216
+ end
2219
2217
end
2220
2218
end
2221
2219
You can’t perform that action at this time.
0 commit comments