File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,28 @@ def test_payload_name_on_load_coerced
351
351
Book . send ( :load_schema! )
352
352
original_test_payload_name_on_load
353
353
end
354
+
355
+ # Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
356
+ coerce_tests! :test_payload_row_count_on_select_all
357
+ def test_payload_row_count_on_select_all_coerced
358
+ connection . remove_index ( :books , column : [ :author_id , :name ] )
359
+
360
+ original_test_payload_row_count_on_select_all
361
+ ensure
362
+ Book . where ( author_id : nil , name : 'row count book 1' ) . delete_all
363
+ Book . lease_connection . add_index ( :books , [ :author_id , :name ] , unique : true )
364
+ end
365
+
366
+ # Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
367
+ coerce_tests! :test_payload_row_count_on_raw_sql
368
+ def test_payload_row_count_on_raw_sql_coerced
369
+ connection . remove_index ( :books , column : [ :author_id , :name ] )
370
+
371
+ original_test_payload_row_count_on_raw_sql
372
+ ensure
373
+ Book . where ( author_id : nil , name : 'row count book 3' ) . delete_all
374
+ Book . lease_connection . add_index ( :books , [ :author_id , :name ] , unique : true )
375
+ end
354
376
end
355
377
end
356
378
You can’t perform that action at this time.
0 commit comments