File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 22
33
44
5+ require 'models/event'
6+ class UniquenessValidationTest < ActiveRecord ::TestCase
7+ # So sp_executesql swallows this exception. Run without prpared to see it.
8+ coerce_tests! :test_validate_uniqueness_with_limit
9+ def test_validate_uniqueness_with_limit_coerced
10+ connection . unprepared_statement do
11+ assert_raise ( ActiveRecord ::ValueTooLong ) do
12+ Event . create ( title : "abcdefgh" )
13+ end
14+ end
15+ end
16+
17+ # So sp_executesql swallows this exception. Run without prpared to see it.
18+ coerce_tests! :test_validate_uniqueness_with_limit_and_utf8
19+ def test_validate_uniqueness_with_limit_and_utf8_coerced
20+ connection . unprepared_statement do
21+ assert_raise ( ActiveRecord ::ValueTooLong ) do
22+ Event . create ( title : "一二三四五六七八" )
23+ end
24+ end
25+ end
26+ end
27+
28+
29+
30+
531require 'models/event'
632module ActiveRecord
733 class AdapterTest < ActiveRecord ::TestCase
You can’t perform that action at this time.
0 commit comments