Skip to content

Commit bfd77e5

Browse files
committed
Coerce test
1 parent 6cf056b commit bfd77e5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/cases/coerced_tests.rb

+11
Original file line numberDiff line numberDiff line change
@@ -2152,6 +2152,17 @@ def test_in_order_of_with_enums_keys_coerced
21522152
Book.where(author_id: nil, name: nil).delete_all
21532153
Book.connection.add_index(:books, [:author_id, :name], unique: true)
21542154
end
2155+
2156+
# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
2157+
coerce_tests! :test_in_order_of_with_nil
2158+
def test_in_order_of_with_nil_coerced
2159+
Book.connection.remove_index(:books, column: [:author_id, :name])
2160+
2161+
original_test_in_order_of_with_nil
2162+
ensure
2163+
Book.where(author_id: nil, name: nil).delete_all
2164+
Book.connection.add_index(:books, [:author_id, :name], unique: true)
2165+
end
21552166
end
21562167

21572168
require "models/dashboard"

0 commit comments

Comments
 (0)