Validate project identifier only when changed (#3352).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2762 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-05-25 18:01:27 +00:00
parent 70340910de
commit bd42b7cd9e
2 changed files with 16 additions and 6 deletions
+14
View File
@@ -48,6 +48,20 @@ class ProjectTest < Test::Unit::TestCase
assert_equal I18n.translate('activerecord.errors.messages.blank'), @ecookbook.errors.on(:name)
end
def test_validate_identifier
to_test = {"abc" => true,
"ab12" => true,
"ab-12" => true,
"12" => false}
to_test.each do |identifier, valid|
p = Project.new
p.identifier = identifier
p.valid?
assert_equal valid, p.errors.on('identifier').nil?
end
end
def test_archive
user = @ecookbook.members.first.user
@ecookbook.archive