diff options
author | wmoxam <wesley.moxam@savvica.com> | 2008-09-11 11:33:15 -0400 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-09-11 17:40:14 +0200 |
commit | 923f4ecad202e45ef117d592053c8b86549eb9d7 (patch) | |
tree | cd3cb4e898b3b8eab54144e3861e77b108da9fc5 /activerecord/test/cases | |
parent | c98cb8ffc2f42bff565994951af9412e52fcdc58 (diff) | |
download | rails-923f4ecad202e45ef117d592053c8b86549eb9d7.tar.gz rails-923f4ecad202e45ef117d592053c8b86549eb9d7.tar.bz2 rails-923f4ecad202e45ef117d592053c8b86549eb9d7.zip |
Fixes validates_uniquness_of problem with case insensitive string containing newline characters
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/validations_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb index 1f5f9fd489..c049659327 100644 --- a/activerecord/test/cases/validations_test.rb +++ b/activerecord/test/cases/validations_test.rb @@ -364,6 +364,13 @@ class ValidationsTest < ActiveRecord::TestCase assert t2.save, "Should now save t2 as unique" end + def test_validates_uniquness_with_newline_chars + Topic.validates_uniqueness_of(:title, :case_sensitive => false) + + t = Topic.new("title" => "new\nline") + assert t.save, "Should save t as unique" + end + def test_validate_uniqueness_with_scope Reply.validates_uniqueness_of(:content, :scope => "parent_id") |