Skip to content

Commit

Permalink
Added a uniqueness validation test that uses diacritics.
Browse files Browse the repository at this point in the history
[#2883 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
hugopeixoto authored and jeremy committed Aug 9, 2009
1 parent c2f9c42 commit ff60ec4
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -43,13 +43,13 @@ class UniquenessValidationTest < ActiveRecord::TestCase
def test_validate_uniqueness
Topic.validates_uniqueness_of(:title)

t = Topic.new("title" => "I'm unique!")
t = Topic.new("title" => "I'm uniqué!")
assert t.save, "Should save t as unique"

t.content = "Remaining unique"
assert t.save, "Should still save t as unique"

t2 = Topic.new("title" => "I'm unique!")
t2 = Topic.new("title" => "I'm uniqué!")
assert !t2.valid?, "Shouldn't be valid"
assert !t2.save, "Shouldn't save t2 as unique"
assert_equal ["has already been taken"], t2.errors[:title]
Expand Down

0 comments on commit ff60ec4

Please sign in to comment.