Skip to content

Commit 92e5d60

Browse files
committed
Coerced tests
1 parent 5cb2520 commit 92e5d60

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/cases/coerced_tests.rb

+22
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,28 @@ def test_payload_name_on_load_coerced
351351
Book.send(:load_schema!)
352352
original_test_payload_name_on_load
353353
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
354376
end
355377
end
356378

0 commit comments

Comments
 (0)