File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -337,19 +337,21 @@ def test_upsert_logs_message_including_model_name
337
337
end
338
338
end
339
339
340
- def test_upsert_and_db_warnings
341
- skip unless supports_insert_on_duplicate_update?
340
+ unless in_memory_db?
341
+ def test_upsert_and_db_warnings
342
+ skip unless supports_insert_on_duplicate_update?
342
343
343
- begin
344
- with_db_warnings_action ( :raise ) do
345
- assert_nothing_raised do
346
- Book . upsert ( { id : 1001 , name : "Remote" , author_id : 1 } )
344
+ begin
345
+ with_db_warnings_action ( :raise ) do
346
+ assert_nothing_raised do
347
+ Book . upsert ( { id : 1001 , name : "Remote" , author_id : 1 } )
348
+ end
347
349
end
350
+ ensure
351
+ # We need to explicitly remove the record, because `with_db_warnings_action`
352
+ # prevents the wrapping transaction to be rolled back.
353
+ Book . delete ( 1001 )
348
354
end
349
- ensure
350
- # We need to explicitly remove the record, because `with_db_warnings_action`
351
- # prevents the wrapping transaction to be rolled back.
352
- Book . delete ( 1001 )
353
355
end
354
356
end
355
357
You can’t perform that action at this time.
0 commit comments