diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-04-11 06:27:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-04-11 06:27:54 +0000 |
commit | 5cd29b1a6b042082625867d2b96828e564a60a92 (patch) | |
tree | 5ed9a271fa0bc0f0312e5c34e03a2ccdb387a5a2 /test/unit | |
parent | a769aedb449218ed618c0bdddc4668eb4c11b3ff (diff) | |
download | redmine-5cd29b1a6b042082625867d2b96828e564a60a92.tar.gz redmine-5cd29b1a6b042082625867d2b96828e564a60a92.zip |
Fixed that 2 repositories can be created with blank/nil identifier (#19400).
git-svn-id: http://svn.redmine.org/redmine/trunk@14156 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/repository_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb index 8f8cb9a0a..daa859b3b 100644 --- a/test/unit/repository_test.rb +++ b/test/unit/repository_test.rb @@ -94,6 +94,18 @@ class RepositoryTest < ActiveSupport::TestCase assert !r.save end + def test_2_repositories_with_blank_identifier_and_one_as_default_should_not_be_valid + Repository::Subversion.create!(:project_id => 3, :identifier => '', :url => 'file:///foo', :is_default => true) + r = Repository::Subversion.new(:project_id => 3, :identifier => '', :url => 'file:///bar') + assert !r.save + end + + def test_2_repositories_with_blank_and_nil_identifier_should_not_be_valid + Repository::Subversion.create!(:project_id => 3, :identifier => nil, :url => 'file:///foo') + r = Repository::Subversion.new(:project_id => 3, :identifier => '', :url => 'file:///bar') + assert !r.save + end + def test_first_repository_should_be_set_as_default repository1 = Repository::Subversion.new( :project => Project.find(3), |