File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 44
55require 'models/event'
66class UniquenessValidationTest < ActiveRecord ::TestCase
7- # So sp_executesql swallows this exception. Run without prpared to see it.
7+ # So sp_executesql swallows this exception. Run without prepared to see it.
88 coerce_tests! :test_validate_uniqueness_with_limit
99 def test_validate_uniqueness_with_limit_coerced
1010 connection . unprepared_statement do
@@ -14,7 +14,7 @@ def test_validate_uniqueness_with_limit_coerced
1414 end
1515 end
1616
17- # So sp_executesql swallows this exception. Run without prpared to see it.
17+ # So sp_executesql swallows this exception. Run without prepared to see it.
1818 coerce_tests! :test_validate_uniqueness_with_limit_and_utf8
1919 def test_validate_uniqueness_with_limit_and_utf8_coerced
2020 connection . unprepared_statement do
@@ -23,6 +23,15 @@ def test_validate_uniqueness_with_limit_and_utf8_coerced
2323 end
2424 end
2525 end
26+
27+ # Skip the test if database is case-insensitive.
28+ coerce_tests! :test_validate_case_sensitive_uniqueness_by_default
29+ def test_validate_case_sensitive_uniqueness_by_default_coerced
30+ database_collation = connection . select_one ( "SELECT collation_name FROM sys.databases WHERE name = 'activerecord_unittest'" ) . values . first
31+ skip if database_collation . include? ( '_CI_' )
32+
33+ original_test_validate_case_sensitive_uniqueness_by_default_coerced
34+ end
2635end
2736
2837
You can’t perform that action at this time.
0 commit comments