Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2458,6 +2458,39 @@ def test_in_order_of_with_array_values_with_nil_coerced
Book.where(author_id: nil, name: nil).delete_all
Book.lease_connection.add_index(:books, [:author_id, :name], unique: true)
end

# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
coerce_tests! :test_in_order_of_with_out_of_bound_integer_does_not_match_nulls
def test_in_order_of_with_out_of_bound_integer_does_not_match_nulls_coerced
Book.lease_connection.remove_index(:books, column: [:author_id, :name])

original_test_in_order_of_with_out_of_bound_integer_does_not_match_nulls
ensure
Book.where(author_id: nil, name: nil).delete_all
Book.lease_connection.add_index(:books, [:author_id, :name], unique: true)
end

# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
coerce_tests! :test_in_order_of_with_only_unrepresentable_values_does_not_build_empty_case
def test_in_order_of_with_only_unrepresentable_values_does_not_build_empty_case_coerced
Book.lease_connection.remove_index(:books, column: [:author_id, :name])

original_test_in_order_of_with_only_unrepresentable_values_does_not_build_empty_case
ensure
Book.where(author_id: nil, name: nil).delete_all
Book.lease_connection.add_index(:books, [:author_id, :name], unique: true)
end

# Need to remove index as SQL Server considers NULLs on a unique-index to be equal unlike PostgreSQL/MySQL/SQLite.
coerce_tests! :test_in_order_of_with_unknown_enum_key_does_not_match_nulls
def test_in_order_of_with_unknown_enum_key_does_not_match_nulls_coerced
Book.lease_connection.remove_index(:books, column: [:author_id, :name])

original_test_in_order_of_with_unknown_enum_key_does_not_match_nulls
ensure
Book.where(author_id: nil, name: nil).delete_all
Book.lease_connection.add_index(:books, [:author_id, :name], unique: true)
end
end

class QueryLogsTest < ActiveRecord::TestCase
Expand Down
Loading