fix tags and fix tests

This commit is contained in:
Reinier Balt 2008-12-22 23:26:38 +01:00
parent c618d35d3a
commit 0e68ded56a
8 changed files with 856 additions and 836 deletions

View file

@ -4,7 +4,26 @@ class TagTest < Test::Rails::TestCase
fixtures :tags
# Replace this with your real tests.
def test_truth
assert true
def test_find_or_create_with_single_word
tag = Tag.find_or_create_by_name("test")
assert !tag.new_record?
end
def test_find_or_create_with_space
tag = Tag.find_or_create_by_name("test test")
assert !tag.new_record?
end
def test_find_or_create_with_dot
tag = Tag.find_or_create_by_name("a.b.c")
assert !tag.new_record?
end
def test_find_or_create_with_number_as_string
tag = Tag.find_or_create_by_name("12343")
assert !tag.new_record?
tag = Tag.find_or_create_by_name("8.1.2")
assert !tag.new_record?
end
end