Rails 6.1: Coerce test to handle default case-insensitive collation #915
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
UniquenessValidationTest#test_validate_uniqueness_by_default_database_collation
test only assumed case insensitive collation for MySQL (see https://github.com/rails/rails/blob/0beae875eea321143ec4208df93e43fa3ebf39be/activerecord/test/cases/validations/uniqueness_validation_test.rb#L349). By default, the SQL Server tests also use a case-insensitive collation. In this MR I have coerced the Rails suite test and added a slightly different test for SQL Server.Previously this test was called
test_validate_case_sensitive_uniqueness_by_default
and was renamed totest_validate_uniqueness_by_default_database_collation
in rails/rails@3daf2c7. We used to coercetest_validate_case_sensitive_uniqueness_by_default
but that coercion was removed in https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/887/files#diff-3f00d8ac91cdd36f48a1f18eb12bf3dc8d3cb7e48f7d21fc891ea63dfb6fd9ecL28